Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead #2370

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ Increment the:

## [Unreleased]

* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)

Breaking changes:

* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
* The experimental `CMake` option `WITH_REMOVE_METER_PREVIEW` is removed,
use option `WITH_ABI_VERSION_2` instead.

## [1.12.0] 2023-10-16

* [BUILD] Support `pkg-config`
Expand Down
5 changes: 0 additions & 5 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ if(WITH_ASYNC_EXPORT_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_ASYNC_EXPORT)
endif()

if(WITH_REMOVE_METER_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_REMOVE_METER_PREVIEW)
endif()

target_compile_definitions(
opentelemetry_api
INTERFACE OPENTELEMETRY_ABI_VERSION_NO=${OPENTELEMETRY_ABI_VERSION_NO})
Expand Down
14 changes: 13 additions & 1 deletion api/include/opentelemetry/metrics/meter_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,19 @@ class MeterProvider
nostd::string_view schema_url = "") noexcept = 0;
#endif

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
/**
* Remove a named Meter instance (ABI).
*
* This API is experimental, see
* https://github.com/open-telemetry/opentelemetry-specification/issues/2232
*
* @since ABI_VERSION 2
*
* @param[in] name Meter instrumentation scope
* @param[in] version Instrumentation scope version, optional
* @param[in] schema_url Instrumentation scope schema URL, optional
*/
virtual void RemoveMeter(nostd::string_view name,
nostd::string_view version = "",
nostd::string_view schema_url = "") noexcept = 0;
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/metrics/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class NoopMeterProvider final : public MeterProvider
}
#endif

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
void RemoveMeter(nostd::string_view /* name */,
nostd::string_view /* version */,
nostd::string_view /* schema_url */) noexcept override
Expand Down
4 changes: 0 additions & 4 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -135,7 +134,6 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -159,7 +157,6 @@ elif [[ "$1" == "cmake.maintainer.cpp11.async.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -181,7 +178,6 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/metrics/meter_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MeterProvider final : public opentelemetry::metrics::MeterProvider
nostd::string_view schema_url = "") noexcept override;
#endif

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
void RemoveMeter(nostd::string_view name,
nostd::string_view version,
nostd::string_view schema_url) noexcept override;
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/metrics/meter_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ nostd::shared_ptr<metrics_api::Meter> MeterProvider::GetMeter(
return nostd::shared_ptr<metrics_api::Meter>{meter};
}

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
void MeterProvider::RemoveMeter(nostd::string_view name,
nostd::string_view version,
nostd::string_view schema_url) noexcept
Expand Down
4 changes: 2 additions & 2 deletions sdk/test/metrics/meter_provider_sdk_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ TEST(MeterProvider, GetMeterAbiv2)
}
#endif /* OPENTELEMETRY_ABI_VERSION_NO >= 2 */

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
TEST(MeterProvider, RemoveMeter)
{
MeterProvider mp;
Expand Down Expand Up @@ -225,4 +225,4 @@ TEST(MeterProvider, RemoveMeter)
mp.ForceFlush();
mp.Shutdown();
}
#endif
#endif /* OPENTELEMETRY_ABI_VERSION_NO >= 2 */