Skip to content

Commit 96b1361

Browse files
authored
Merge branch 'main' into Metrics_DLL
2 parents b1c4448 + e918960 commit 96b1361

File tree

8 files changed

+28
-15
lines changed

8 files changed

+28
-15
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ 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+
21+
Breaking changes:
22+
23+
* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
24+
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
25+
* The experimental `CMake` option `WITH_REMOVE_METER_PREVIEW` is removed,
26+
use option `WITH_ABI_VERSION_2` instead.
27+
1828
## [1.12.0] 2023-10-16
1929

2030
* [BUILD] Support `pkg-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
@@ -214,7 +214,7 @@ class NoopMeterProvider final : public MeterProvider
214214
}
215215
#endif
216216

217-
#ifdef ENABLE_REMOVE_METER_PREVIEW
217+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
218218
void RemoveMeter(nostd::string_view /* name */,
219219
nostd::string_view /* version */,
220220
nostd::string_view /* schema_url */) noexcept override

ci/do_ci.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
112112
-DWITH_OTLP_HTTP=ON \
113113
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
114114
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
115-
-DWITH_REMOVE_METER_PREVIEW=ON \
116115
-DWITH_PROMETHEUS=ON \
117116
-DWITH_EXAMPLES=ON \
118117
-DWITH_EXAMPLES_HTTP=ON \
@@ -135,7 +134,6 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
135134
-DWITH_OTLP_HTTP=ON \
136135
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
137136
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
138-
-DWITH_REMOVE_METER_PREVIEW=ON \
139137
-DWITH_PROMETHEUS=ON \
140138
-DWITH_EXAMPLES=ON \
141139
-DWITH_EXAMPLES_HTTP=ON \
@@ -159,7 +157,6 @@ elif [[ "$1" == "cmake.maintainer.cpp11.async.test" ]]; then
159157
-DWITH_OTLP_HTTP=ON \
160158
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
161159
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
162-
-DWITH_REMOVE_METER_PREVIEW=ON \
163160
-DWITH_PROMETHEUS=ON \
164161
-DWITH_EXAMPLES=ON \
165162
-DWITH_EXAMPLES_HTTP=ON \
@@ -181,7 +178,6 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
181178
-DWITH_OTLP_HTTP=ON \
182179
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
183180
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
184-
-DWITH_REMOVE_METER_PREVIEW=ON \
185181
-DWITH_PROMETHEUS=ON \
186182
-DWITH_EXAMPLES=ON \
187183
-DWITH_EXAMPLES_HTTP=ON \

sdk/include/opentelemetry/sdk/metrics/meter_provider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class OPENTELEMETRY_EXPORT MeterProvider final : public opentelemetry::metrics::
6666
nostd::string_view schema_url = "") noexcept override;
6767
#endif
6868

69-
#ifdef ENABLE_REMOVE_METER_PREVIEW
69+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
7070
void RemoveMeter(nostd::string_view name,
7171
nostd::string_view version,
7272
nostd::string_view schema_url) noexcept override;

sdk/src/metrics/meter_provider.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ nostd::shared_ptr<metrics_api::Meter> MeterProvider::GetMeter(
7575
return nostd::shared_ptr<metrics_api::Meter>{meter};
7676
}
7777

78-
#ifdef ENABLE_REMOVE_METER_PREVIEW
78+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
7979
void MeterProvider::RemoveMeter(nostd::string_view name,
8080
nostd::string_view version,
8181
nostd::string_view schema_url) noexcept

sdk/test/metrics/meter_provider_sdk_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ TEST(MeterProvider, GetMeterAbiv2)
191191
}
192192
#endif /* OPENTELEMETRY_ABI_VERSION_NO >= 2 */
193193

194-
#ifdef ENABLE_REMOVE_METER_PREVIEW
194+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
195195
TEST(MeterProvider, RemoveMeter)
196196
{
197197
MeterProvider mp;
@@ -225,4 +225,4 @@ TEST(MeterProvider, RemoveMeter)
225225
mp.ForceFlush();
226226
mp.Shutdown();
227227
}
228-
#endif
228+
#endif /* OPENTELEMETRY_ABI_VERSION_NO >= 2 */

0 commit comments

Comments
 (0)