Skip to content

Commit 272f30f

Browse files
authored
Merge branch 'main' into sync-gauge
2 parents 1248928 + cb603ad commit 272f30f

File tree

121 files changed

+4284
-1567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4284
-1567
lines changed

.github/repository-settings.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Process
2+
3+
This file documents local admin changes for opentelemetry-cpp,
4+
per the community process: https://github.com/open-telemetry/community/blob/main/docs/how-to-configure-new-repository.md
5+
6+
Please note that the EasyCLA check **MUST** stay **REQUIRED**,
7+
it should never be disabled or bypassed, at the risk of tainting the repository.
8+
9+
# Guidelines
10+
11+
The best is to open a PR first that describes the change,
12+
so it can be discussed during review (maybe it is not needed,
13+
maybe there is an alternate solution, ...).
14+
15+
The PR must add a log entry in this file, detailing:
16+
17+
* the date the change is implemented
18+
* what is changed exactly (which setting)
19+
* a short rationale
20+
21+
Admin changes are then applied only when the PR is merged.
22+
23+
If for some reason a change is implemented in emergency,
24+
before a PR can be discussed and merged,
25+
a PR should still be prepared and pushed after the fact to
26+
describe the settings changed.
27+
28+
# Log of local changes
29+
30+
## 2023-11-03
31+
32+
Created log file `.github/repository-settings.md`, since admin permissions are now granted to maintainers.
33+
34+
See https://github.com/open-telemetry/community/issues/1727
35+
36+
No setting changed.
37+
38+

.github/workflows/project_management_comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
issues: write
1313
steps:
1414
- name: Add comment
15-
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa
15+
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2
1616
with:
1717
issue-number: ${{ github.event.issue.number }}
1818
body: |

.github/workflows/project_management_issue_open.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
permissions:
1111
issues: write
1212
steps:
13-
- uses: actions/github-script@v6
13+
- uses: actions/github-script@v7
1414
with:
1515
script: |
1616
github.rest.issues.addLabels({

CHANGELOG.md

Lines changed: 150 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,160 @@ Increment the:
1515

1616
## [Unreleased]
1717

18+
* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
19+
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
20+
* [BUILD] Make WITH_OTLP_HTTP_SSL_PREVIEW mainstream
21+
[#2378](https://github.com/open-telemetry/opentelemetry-cpp/pull/2378)
22+
* [API] Add InstrumentationScope attributes in TracerProvider::GetTracer()
23+
[#2371](https://github.com/open-telemetry/opentelemetry-cpp/pull/2371)
24+
* [BUILD] enum CanonicalCode names too generic... conflict with old C defines
25+
[#2385](https://github.com/open-telemetry/opentelemetry-cpp/pull/2385)
26+
* [API] Add a new AddLink() operation to Span
27+
[#2380](https://github.com/open-telemetry/opentelemetry-cpp/pull/2380)
28+
* [SDK] Fix GetLogger with empty library name
29+
[#2398](https://github.com/open-telemetry/opentelemetry-cpp/pull/2398)
30+
* [EXPORTER] Rework OTLP/HTTP and OTLP/GRPC exporter options
31+
[#2388](https://github.com/open-telemetry/opentelemetry-cpp/pull/2388)
32+
33+
Important changes:
34+
35+
* [API] Add InstrumentationScope attributes in TracerProvider::GetTracer()
36+
[#2371](https://github.com/open-telemetry/opentelemetry-cpp/pull/2371)
37+
* TracerProvider::GetTracer() now accepts InstrumentationScope attributes.
38+
* Because this is an `ABI` breaking change, the fix is only available
39+
with the `CMake` option `WITH_ABI_VERSION_2=ON`.
40+
* When building with `CMake` option `WITH_ABI_VERSION_1=ON` (by default)
41+
the `ABI` is unchanged, and the fix is not available.
42+
43+
* [API] Add a new AddLink() operation to Span
44+
[#2380](https://github.com/open-telemetry/opentelemetry-cpp/pull/2380)
45+
* New `API` Span::AddLink() adds a single link to a span.
46+
* New `API` Span::AddLinks() adds multiple links to a span.
47+
* Because this is an `ABI` breaking change, the fix is only available
48+
with the `CMake` option `WITH_ABI_VERSION_2=ON`.
49+
* When building with `CMake` option `WITH_ABI_VERSION_1=ON` (by default)
50+
the `ABI` is unchanged, and the fix is not available.
51+
52+
* [BUILD] Make WITH_OTLP_HTTP_SSL_PREVIEW mainstream
53+
[#2378](https://github.com/open-telemetry/opentelemetry-cpp/pull/2378)
54+
* The experimental `CMake` option `WITH_OTLP_HTTP_SSL_PREVIEW`
55+
is now promoted to stable. The default is changed to `ON`.
56+
* The experimental `CMake` option `WITH_OTLP_HTTP_SSL_TLS_PREVIEW`
57+
is now promoted to stable. The default is changed to `ON`.
58+
* These build options are scheduled to be removed by the next release,
59+
building without SSL/TLS will no longer be possible.
60+
61+
* [EXPORTER] Rework OTLP/HTTP and OTLP/GRPC exporter options
62+
[#2388](https://github.com/open-telemetry/opentelemetry-cpp/pull/2388)
63+
* `OtlpGrpcMetricExporterOptions` used to honor `_TRACES_`
64+
environment variables, instead of `_METRICS_` environment variables.
65+
* The implementation of `OtlpGrpcMetricExporterOptions` is now fixed.
66+
* Please check configuration variables,
67+
to make sure `_METRICS_` variables are set as expected.
68+
69+
Breaking changes:
70+
71+
* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
72+
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
73+
* The experimental `CMake` option `WITH_REMOVE_METER_PREVIEW` is removed,
74+
use option `WITH_ABI_VERSION_2` instead.
75+
76+
* [BUILD] enum CanonicalCode names too generic... conflict with old C defines
77+
[#2385](https://github.com/open-telemetry/opentelemetry-cpp/pull/2385)
78+
* Header file `opentelemetry/trace/canonical_code.h` is unused,
79+
and is now removed.
80+
* This header should not be included directly in an application.
81+
If this is the case, please remove any remaining include directives.
82+
83+
* [BUILD] Fix exported definitions when building DLL with STL
84+
[#2387](https://github.com/open-telemetry/opentelemetry-cpp/pull/2387)
85+
* The MeterSelector, MeterSelectorFactory, InstrumentSelector,
86+
and InstrumentSelectorFactory APIs now use const std::string&
87+
instead of nostd::string_view for name, version and schema to
88+
maintain a single export definition for DLL.
89+
90+
* [EXPORTER] Rework OTLP/HTTP and OTLP/GRPC exporter options
91+
[#2388](https://github.com/open-telemetry/opentelemetry-cpp/pull/2388)
92+
* `OtlpGrpcLogRecordExporter` incorrectly used `OtlpGrpcExporterOptions`,
93+
which are options for traces and not logs.
94+
* This created a bug: the `OtlpGrpcLogRecordExporter` honors `_TRACES_`
95+
environment variables, instead of `_LOGS_` environment variables.
96+
* `OtlpGrpcLogRecordExporter` is changed to use
97+
`OtlpGrpcLogRecordExporterOptions` instead, fixing the bug.
98+
* User code that initializes the SDK with a GRPC Log exporter,
99+
and uses exporter options, should adjust to replace
100+
`OtlpGrpcExporterOptions` with `OtlpGrpcLogRecordExporterOptions`.
101+
* Please check configuration variables,
102+
to make sure `_LOGS_` variables are set as expected.
103+
104+
## [1.12.0] 2023-10-16
105+
106+
* [BUILD] Support `pkg-config`
107+
[#2269](https://github.com/open-telemetry/opentelemetry-cpp/pull/2269)
108+
* [CI] Do not automatically close stale issues
109+
[#2277](https://github.com/open-telemetry/opentelemetry-cpp/pull/2277)
110+
* [CI] Benchmark workflow fails, C++14 required to build grpc
111+
[#2278](https://github.com/open-telemetry/opentelemetry-cpp/pull/2278)
112+
* [SDK] Increase metric name maximum length from 63 to 255 characters
113+
[#2284](https://github.com/open-telemetry/opentelemetry-cpp/pull/2284)
114+
* [SEMANTIC CONVENTION] Deprecated semconv (in the spec)
115+
not deprecated (in C++)
116+
[#2285](https://github.com/open-telemetry/opentelemetry-cpp/pull/2285)
117+
* [SDK] Remove unused member variables from SyncMetricStorage
118+
[#2294](https://github.com/open-telemetry/opentelemetry-cpp/pull/2294)
18119
* [DEPRECATION] Deprecate ZPAGES
19120
[#2291](https://github.com/open-telemetry/opentelemetry-cpp/pull/2291)
20-
* [EXPORTER] Remove explicit timestamps from metric points exported by Prometheus
121+
* [API] Deliver ABI breaking changes
122+
[#2222](https://github.com/open-telemetry/opentelemetry-cpp/pull/2222)
123+
* [SDK] Allow metric instrument names to contain / characters
124+
[#2310](https://github.com/open-telemetry/opentelemetry-cpp/pull/2310)
125+
* [SDK] Fix Observable Counters/UpDownCounters
126+
[#2298](https://github.com/open-telemetry/opentelemetry-cpp/pull/2298)
127+
* [SDK] Add exemplar reservoir to async metric storage
128+
[#2319](https://github.com/open-telemetry/opentelemetry-cpp/pull/2319)
129+
* [TEST] Fix lifetime issues in prometheus test utils
130+
[#2322](https://github.com/open-telemetry/opentelemetry-cpp/pull/2322)
131+
* [EXPORTER] Prometheus: Remove explicit timestamps from metric points
21132
[#2324](https://github.com/open-telemetry/opentelemetry-cpp/pull/2324)
22-
* [EXPORTER] Handle attribute key collisions caused by sanitation
133+
* [EXPORTER] Prometheus: Handle attribute key collisions from sanitation
23134
[#2326](https://github.com/open-telemetry/opentelemetry-cpp/pull/2326)
24-
* [EXPORTER] Replace colons with underscores when converting to Prometheus label
135+
* [EXPORTER] Prometheus cleanup, test with TranslateToPrometheus
136+
[#2329](https://github.com/open-telemetry/opentelemetry-cpp/pull/2329)
137+
* [SDK] Fix log message in Meter::RegisterSyncMetricStorage
138+
[#2325](https://github.com/open-telemetry/opentelemetry-cpp/pull/2325)
139+
* [DOC] Simplify the project status section
140+
[#2332](https://github.com/open-telemetry/opentelemetry-cpp/pull/2332)
141+
* [EXPORTER] Prometheus: Sanitize labels according to spec
25142
[#2330](https://github.com/open-telemetry/opentelemetry-cpp/pull/2330)
143+
* [SDK] Fix deadlock when shuting down http client
144+
[#2337](https://github.com/open-telemetry/opentelemetry-cpp/pull/2337)
145+
* [Exporter] Group spans by resource and instrumentation scope
146+
in OTLP export requests
147+
[#2335](https://github.com/open-telemetry/opentelemetry-cpp/pull/2335)
148+
* [BUILD] Need fine-grained HAVE_CPP_STDLIB
149+
[#2304](https://github.com/open-telemetry/opentelemetry-cpp/pull/2304)
26150
* [API] Add InstrumentationScope attributes in MeterProvider::GetMeter()
27151
[#2224](https://github.com/open-telemetry/opentelemetry-cpp/pull/2224)
28152
* [REMOVAL] Drop C++11 support
29153
[#2342](https://github.com/open-telemetry/opentelemetry-cpp/pull/2342)
154+
* [EXPORTER] prometheus: add otel_scope_name and otel_scope_version labels
155+
[#2293](https://github.com/open-telemetry/opentelemetry-cpp/pull/2293)
156+
* [EXPORTER] Export resource for prometheus
157+
[#2301](https://github.com/open-telemetry/opentelemetry-cpp/pull/2301)
158+
* [BUILD] error: read-only reference ‘value’ used as ‘asm’ output
159+
[#2354](https://github.com/open-telemetry/opentelemetry-cpp/pull/2354)
160+
* [BUILD] Build break with external CMake nlohman_json package
161+
[#2353](https://github.com/open-telemetry/opentelemetry-cpp/pull/2353)
162+
* [BUILD] Upgrade libcurl to version 8.4.0
163+
[#2358](https://github.com/open-telemetry/opentelemetry-cpp/pull/2358)
164+
* [BUILD] Fix opentracing-shim when added in super project
165+
[#2356](https://github.com/open-telemetry/opentelemetry-cpp/pull/2356)
166+
* [BUILD] Fix protoc searching with non-imported protobuf::protoc target
167+
[#2362](https://github.com/open-telemetry/opentelemetry-cpp/pull/2362)
168+
* [BUILD] Support to use different cmake package CONFIG of dependencies
169+
[#2263](https://github.com/open-telemetry/opentelemetry-cpp/pull/2263)
170+
* [SEMANTIC CONVENTION] Upgrade to semconv 1.22.0
171+
[#2368](https://github.com/open-telemetry/opentelemetry-cpp/pull/2368)
30172

31173
Important changes:
32174

@@ -65,6 +207,11 @@ Breaking changes:
65207
[#2342](https://github.com/open-telemetry/opentelemetry-cpp/pull/2342)
66208
* Building with C++11 is no longer supported.
67209

210+
Deprecations:
211+
212+
* [DEPRECATION] Deprecate ZPAGES
213+
[#2291](https://github.com/open-telemetry/opentelemetry-cpp/pull/2291)
214+
68215
## [1.11.0] 2023-08-21
69216

70217
* [BUILD] Fix more cases for symbol name for 32-bit win32 DLL build

CMakeLists.txt

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ set(OTELCPP_PROTO_PATH
248248

249249
if(WIN32)
250250
option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON)
251+
else()
252+
if(DEFINED (WITH_ETW))
253+
message(FATAL_ERROR "WITH_ETW is only supported on Windows")
254+
endif()
251255
endif(WIN32)
252256

253257
# Do not convert deprecated message to error
@@ -275,12 +279,12 @@ endif()
275279

276280
option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)
277281

278-
# EXPERIMENTAL
279-
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" OFF)
282+
# STABLE
283+
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" ON)
280284

281-
# EXPERIMENTAL
285+
# STABLE
282286
option(WITH_OTLP_HTTP_SSL_TLS_PREVIEW
283-
"Whether to enable otlp http ssl tls min/max/cipher options" OFF)
287+
"Whether to enable otlp http ssl tls min/max/cipher options" ON)
284288

285289
# Exemplar specs status is experimental, so behind feature flag by default
286290
option(WITH_METRICS_EXEMPLAR_PREVIEW
@@ -430,6 +434,11 @@ if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
430434
if(TARGET protobuf::protoc)
431435
project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE
432436
protobuf::protoc)
437+
# If protobuf::protoc is not a imported target, then we use the target
438+
# directly for fallback
439+
if(NOT PROTOBUF_PROTOC_EXECUTABLE)
440+
set(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
441+
endif()
433442
elseif(Protobuf_PROTOC_EXECUTABLE)
434443
# Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
435444
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
@@ -574,7 +583,6 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")
574583

575584
include(CTest)
576585
if(BUILD_TESTING)
577-
add_definitions(-DENABLE_TEST)
578586
if(EXISTS ${CMAKE_BINARY_DIR}/lib/libgtest.a)
579587
# Prefer GTest from build tree. GTest is not always working with
580588
# CMAKE_PREFIX_PATH
@@ -624,6 +632,9 @@ endif()
624632
include(CMakePackageConfigHelpers)
625633

626634
if(DEFINED OPENTELEMETRY_BUILD_DLL)
635+
if(NOT WIN32)
636+
message(FATAL_ERROR "Build DLL is only supported on Windows!")
637+
endif()
627638
if(NOT MSVC)
628639
message(WARNING "Build DLL is supposed to work with MSVC!")
629640
endif()
@@ -683,6 +694,7 @@ if(NOT WITH_API_ONLY)
683694
endif()
684695

685696
include(cmake/opentelemetry-build-external-component.cmake)
697+
include(cmake/patch-imported-config.cmake)
686698

687699
if(OPENTELEMETRY_INSTALL)
688700
# Export cmake config and support find_packages(opentelemetry-cpp CONFIG)

api/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ if(WITH_ASYNC_EXPORT_PREVIEW)
114114
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_ASYNC_EXPORT)
115115
endif()
116116

117-
if(WITH_REMOVE_METER_PREVIEW)
118-
target_compile_definitions(opentelemetry_api
119-
INTERFACE ENABLE_REMOVE_METER_PREVIEW)
120-
endif()
121-
122117
target_compile_definitions(
123118
opentelemetry_api
124119
INTERFACE OPENTELEMETRY_ABI_VERSION_NO=${OPENTELEMETRY_ABI_VERSION_NO})

api/include/opentelemetry/metrics/meter_provider.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,19 @@ class MeterProvider
126126
nostd::string_view schema_url = "") noexcept = 0;
127127
#endif
128128

129-
#ifdef ENABLE_REMOVE_METER_PREVIEW
129+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
130+
/**
131+
* Remove a named Meter instance (ABI).
132+
*
133+
* This API is experimental, see
134+
* https://github.com/open-telemetry/opentelemetry-specification/issues/2232
135+
*
136+
* @since ABI_VERSION 2
137+
*
138+
* @param[in] name Meter instrumentation scope
139+
* @param[in] version Instrumentation scope version, optional
140+
* @param[in] schema_url Instrumentation scope schema URL, optional
141+
*/
130142
virtual void RemoveMeter(nostd::string_view name,
131143
nostd::string_view version = "",
132144
nostd::string_view schema_url = "") noexcept = 0;

api/include/opentelemetry/metrics/noop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class NoopMeterProvider final : public MeterProvider
257257
}
258258
#endif
259259

260-
#ifdef ENABLE_REMOVE_METER_PREVIEW
260+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
261261
void RemoveMeter(nostd::string_view /* name */,
262262
nostd::string_view /* version */,
263263
nostd::string_view /* schema_url */) noexcept override

api/include/opentelemetry/plugin/tracer.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "opentelemetry/common/key_value_iterable.h"
99
#include "opentelemetry/plugin/detail/tracer_handle.h"
10+
#include "opentelemetry/trace/span_context_kv_iterable.h"
1011
#include "opentelemetry/trace/tracer.h"
1112
#include "opentelemetry/version.h"
1213

@@ -49,6 +50,19 @@ class Span final : public trace::Span
4950
span_->AddEvent(name, timestamp, attributes);
5051
}
5152

53+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
54+
void AddLink(const trace::SpanContext &target,
55+
const common::KeyValueIterable &attrs) noexcept override
56+
{
57+
span_->AddLink(target, attrs);
58+
}
59+
60+
void AddLinks(const trace::SpanContextKeyValueIterable &links) noexcept override
61+
{
62+
span_->AddLinks(links);
63+
}
64+
#endif
65+
5266
void SetStatus(trace::StatusCode code, nostd::string_view description) noexcept override
5367
{
5468
span_->SetStatus(code, description);

0 commit comments

Comments
 (0)