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] DLL export interface for Metrics #2344

Merged
merged 13 commits into from
Oct 23, 2023
12 changes: 11 additions & 1 deletion ci/do_ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ switch ($action) {
cmake $SRC_DIR `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DOPENTELEMETRY_BUILD_DLL=1 `
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
$exit = $LASTEXITCODE
if ($exit -ne 0) {
exit $exit
Expand All @@ -79,6 +79,16 @@ switch ($action) {
if ($exit -ne 0) {
exit $exit
}
examples\metrics_simple\Debug\metrics_ostream_example.exe
$exit = $LASTEXITCODE
if ($exit -ne 0) {
exit $exit
}
examples\logs_simple\Debug\example_logs_simple.exe
$exit = $LASTEXITCODE
if ($exit -ne 0) {
exit $exit
}
}
"cmake.maintainer.test" {
cd "$BUILD_DIR"
Expand Down
8 changes: 7 additions & 1 deletion examples/common/metrics_foo_library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a problem of this PR, but I think we should use if(OPENTELEMETRY_BUILD_DLL) instead of if(DEFINED OPENTELEMETRY_BUILD_DLL). And use target_compile_definitions(opentelemetry_api INTERFACE OPENTELEMETRY_BUILD_IMPORT_DLL) instead of add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL), so we can exporting this definition to cmake package.

add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

add_library(common_metrics_foo_library foo_library.h foo_library.cc)
set_target_version(common_metrics_foo_library)
target_link_libraries(common_metrics_foo_library PUBLIC opentelemetry_api)

target_link_libraries(common_metrics_foo_library
PUBLIC ${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
19 changes: 15 additions & 4 deletions examples/metrics_simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

if(DEFINED OPENTELEMETRY_BUILD_DLL)
add_definitions(-DOPENTELEMETRY_BUILD_IMPORT_DLL)
endif()

include_directories(${CMAKE_SOURCE_DIR}/exporters/ostream/include)

add_executable(metrics_ostream_example metrics_ostream.cc)
target_link_libraries(
metrics_ostream_example ${CMAKE_THREAD_LIBS_INIT} opentelemetry_metrics
opentelemetry_exporter_ostream_metrics opentelemetry_resources
common_metrics_foo_library)
target_link_libraries(metrics_ostream_example ${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_link_libraries(metrics_ostream_example opentelemetry_cpp)
else()
target_link_libraries(
metrics_ostream_example opentelemetry_metrics
opentelemetry_exporter_ostream_metrics opentelemetry_resources)
endif()
28 changes: 20 additions & 8 deletions examples/otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ if(WITH_OTLP_GRPC)

add_executable(example_otlp_grpc_metric grpc_metric_main.cc)

target_link_libraries(
example_otlp_grpc_metric ${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library opentelemetry_metrics
opentelemetry_exporter_otlp_grpc_metrics)
target_link_libraries(example_otlp_grpc_metric ${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_link_libraries(example_otlp_grpc_metric opentelemetry_cpp)
else()
target_link_libraries(example_otlp_grpc_metric opentelemetry_metrics
opentelemetry_exporter_otlp_grpc_metrics)
endif()

# LOG

Expand Down Expand Up @@ -66,10 +71,17 @@ if(WITH_OTLP_HTTP)
# METRIC

add_executable(example_otlp_http_metric http_metric_main.cc)
target_link_libraries(
example_otlp_http_metric ${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library opentelemetry_metrics
opentelemetry_exporter_otlp_http_metric)
target_link_libraries(example_otlp_http_metric ${CMAKE_THREAD_LIBS_INIT}
common_metrics_foo_library)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
target_link_libraries(example_otlp_http_metric opentelemetry_cpp
opentelemetry_common)
else()
target_link_libraries(
example_otlp_http_metric common_metrics_foo_library opentelemetry_metrics
opentelemetry_exporter_otlp_http_metric)
endif()

# LOG

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace otlp
/**
* Factory class for OtlpGrpcMetricExporter.
*/
class OtlpGrpcMetricExporterFactory
class OPENTELEMETRY_EXPORT OtlpGrpcMetricExporterFactory
{
public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace otlp
/**
* Factory class for OtlpHttpMetricExporter.
*/
class OtlpHttpMetricExporterFactory
class OPENTELEMETRY_EXPORT OtlpHttpMetricExporterFactory
{
public:
/**
Expand Down
14 changes: 14 additions & 0 deletions ext/src/dll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ if(WITH_OTLP_HTTP)
PRIVATE opentelemetry_exporter_otlp_http)
endif()

target_link_libraries(
opentelemetry_cpp PRIVATE opentelemetry_metrics
opentelemetry_exporter_ostream_metrics)

if(WITH_OTLP_GRPC)
target_link_libraries(opentelemetry_cpp
PRIVATE opentelemetry_exporter_otlp_grpc_metrics)
endif()

if(WITH_OTLP_HTTP)
target_link_libraries(opentelemetry_cpp
PRIVATE opentelemetry_exporter_otlp_http_metric)
endif()

target_link_libraries(
opentelemetry_cpp PRIVATE opentelemetry_logs
opentelemetry_exporter_ostream_logs)
Expand Down
37 changes: 37 additions & 0 deletions ext/src/dll/opentelemetry_cpp.src
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,48 @@ EXPORTS
?ForceFlush@TracerProvider@trace@sdk@v1@opentelemetry@@QEAA_NV?$duration@_JU?$ratio@$00$0PECEA@@std@@@chrono@std@@@Z
?ForceFlush@LoggerProvider@logs@sdk@v1@opentelemetry@@QEAA_NV?$duration@_JU?$ratio@$00$0PECEA@@std@@@chrono@std@@@Z
??0OStreamLogRecordExporter@logs@exporter@v1@opentelemetry@@QEAA@AEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z

// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::PushMetricExporter,struct std::default_delete<class opentelemetry::v1::sdk::metrics::PushMetricExporter> > __cdecl opentelemetry::v1::exporter::metrics::OStreamMetricExporterFactory::Create(void)
?Create@OStreamMetricExporterFactory@metrics@exporter@v1@opentelemetry@@SA?AV?$unique_ptr@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@U?$default_delete@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@@std@@@std@@XZ
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::MetricReader,struct std::default_delete<class opentelemetry::v1::sdk::metrics::MetricReader> > __cdecl opentelemetry::v1::sdk::metrics::PeriodicExportingMetricReaderFactory::Create(class std::unique_ptr<class opentelemetry::v1::sdk::metrics::PushMetricExporter,struct std::default_delete<class opentelemetry::v1::sdk::metrics::PushMetricExporter> >,struct opentelemetry::v1::sdk::metrics::PeriodicExportingMetricReaderOptions const & __ptr64)
?Create@PeriodicExportingMetricReaderFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMetricReader@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMetricReader@metrics@sdk@v1@opentelemetry@@@std@@@std@@V?$unique_ptr@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@U?$default_delete@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@@std@@@7@AEBUPeriodicExportingMetricReaderOptions@2345@@Z
// public: static class std::unique_ptr<class opentelemetry::v1::metrics::MeterProvider,struct std::default_delete<class opentelemetry::v1::metrics::MeterProvider> > __cdecl opentelemetry::v1::sdk::metrics::MeterProviderFactory::Create(void)
?Create@MeterProviderFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMeterProvider@metrics@v1@opentelemetry@@U?$default_delete@VMeterProvider@metrics@v1@opentelemetry@@@std@@@std@@XZ
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::MeterContext,struct std::default_delete<class opentelemetry::v1::sdk::metrics::MeterContext> > __cdecl opentelemetry::v1::sdk::metrics::MeterContextFactory::Create(void)
?Create@MeterContextFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMeterContext@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMeterContext@metrics@sdk@v1@opentelemetry@@@std@@@std@@XZ
// public: static class std::unique_ptr<class opentelemetry::v1::metrics::MeterProvider,struct std::default_delete<class opentelemetry::v1::metrics::MeterProvider> > __cdecl opentelemetry::v1::sdk::metrics::MeterProviderFactory::Create(class std::unique_ptr<class opentelemetry::v1::sdk::metrics::MeterContext,struct std::default_delete<class opentelemetry::v1::sdk::metrics::MeterContext> >)
?Create@MeterProviderFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMeterProvider@metrics@v1@opentelemetry@@U?$default_delete@VMeterProvider@metrics@v1@opentelemetry@@@std@@@std@@V?$unique_ptr@VMeterContext@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMeterContext@metrics@sdk@v1@opentelemetry@@@std@@@7@@Z
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::View,struct std::default_delete<class opentelemetry::v1::sdk::metrics::View> > __cdecl opentelemetry::v1::sdk::metrics::ViewFactory::Create(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum opentelemetry::v1::sdk::metrics::AggregationType,class std::shared_ptr<class opentelemetry::v1::sdk::metrics::AggregationConfig>)
?Create@ViewFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VView@metrics@sdk@v1@opentelemetry@@U?$default_delete@VView@metrics@sdk@v1@opentelemetry@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@7@00W4AggregationType@2345@V?$shared_ptr@VAggregationConfig@metrics@sdk@v1@opentelemetry@@@7@@Z
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::View,struct std::default_delete<class opentelemetry::v1::sdk::metrics::View> > __cdecl opentelemetry::v1::sdk::metrics::ViewFactory::Create(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum opentelemetry::v1::sdk::metrics::AggregationType)
?Create@ViewFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VView@metrics@sdk@v1@opentelemetry@@U?$default_delete@VView@metrics@sdk@v1@opentelemetry@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@7@00W4AggregationType@2345@@Z
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::MeterSelector,struct std::default_delete<class opentelemetry::v1::sdk::metrics::MeterSelector> > __cdecl opentelemetry::v1::sdk::metrics::MeterSelectorFactory::Create(class opentelemetry::v1::nostd::string_view,class opentelemetry::v1::nostd::string_view,class opentelemetry::v1::nostd::string_view)
?Create@MeterSelectorFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VMeterSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMeterSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@Vstring_view@nostd@45@00@Z
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::InstrumentSelector,struct std::default_delete<class opentelemetry::v1::sdk::metrics::InstrumentSelector> > __cdecl opentelemetry::v1::sdk::metrics::InstrumentSelectorFactory::Create(enum opentelemetry::v1::sdk::metrics::InstrumentType,class opentelemetry::v1::nostd::string_view,class opentelemetry::v1::nostd::string_view)
?Create@InstrumentSelectorFactory@metrics@sdk@v1@opentelemetry@@SA?AV?$unique_ptr@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@W4InstrumentType@2345@Vstring_view@nostd@45@1@Z

// public: void __cdecl opentelemetry::v1::sdk::metrics::MeterContext::AddMetricReader(class std::shared_ptr<class opentelemetry::v1::sdk::metrics::MetricReader>)
?AddMetricReader@MeterContext@metrics@sdk@v1@opentelemetry@@QEAAXV?$shared_ptr@VMetricReader@metrics@sdk@v1@opentelemetry@@@std@@@Z
// public: void __cdecl opentelemetry::v1::sdk::metrics::MeterProvider::AddMetricReader(class std::shared_ptr<class opentelemetry::v1::sdk::metrics::MetricReader>)
?AddMetricReader@MeterProvider@metrics@sdk@v1@opentelemetry@@QEAAXV?$shared_ptr@VMetricReader@metrics@sdk@v1@opentelemetry@@@std@@@Z
// public: void __cdecl opentelemetry::v1::sdk::metrics::MeterProvider::AddView(class std::unique_ptr<class opentelemetry::v1::sdk::metrics::InstrumentSelector,struct std::default_delete<class opentelemetry::v1::sdk::metrics::InstrumentSelector> >,class std::unique_ptr<class opentelemetry::v1::sdk::metrics::MeterSelector,struct std::default_delete<class opentelemetry::v1::sdk::metrics::MeterSelector> >,class std::unique_ptr<class opentelemetry::v1::sdk::metrics::View,struct std::default_delete<class opentelemetry::v1::sdk::metrics::View> >)
?AddView@MeterProvider@metrics@sdk@v1@opentelemetry@@QEAAXV?$unique_ptr@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VInstrumentSelector@metrics@sdk@v1@opentelemetry@@@std@@@std@@V?$unique_ptr@VMeterSelector@metrics@sdk@v1@opentelemetry@@U?$default_delete@VMeterSelector@metrics@sdk@v1@opentelemetry@@@std@@@7@V?$unique_ptr@VView@metrics@sdk@v1@opentelemetry@@U?$default_delete@VView@metrics@sdk@v1@opentelemetry@@@std@@@7@@Z


#if defined(WITH_OTLP_GRPC) || defined(WITH_OTLP_HTTP)
?GetOtlpDefaultTracesTimeout@otlp@exporter@v1@opentelemetry@@YA?AV?$duration@_JU?$ratio@$00$0JIJGIA@@std@@@chrono@std@@XZ
?GetOtlpDefaultTracesHeaders@otlp@exporter@v1@opentelemetry@@YA?AV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@Ucmp_ic@otlp@exporter@v1@opentelemetry@@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@XZ
?GetOtlpDefaultLogsTimeout@otlp@exporter@v1@opentelemetry@@YA?AV?$duration@_JU?$ratio@$00$0JIJGIA@@std@@@chrono@std@@XZ
?GetOtlpDefaultLogsHeaders@otlp@exporter@v1@opentelemetry@@YA?AV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@Ucmp_ic@otlp@exporter@v1@opentelemetry@@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@XZ
?GetOtlpDefaultMetricsTimeout@otlp@exporter@v1@opentelemetry@@YA?AV?$duration@_JU?$ratio@$00$0JIJGIA@@std@@@chrono@std@@XZ
?GetOtlpDefaultMetricsHeaders@otlp@exporter@v1@opentelemetry@@YA?AV?$multimap@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@Ucmp_ic@otlp@exporter@v1@opentelemetry@@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@XZ
#endif // defined(WITH_OTLP_GRPC) || defined(WITH_OTLP_HTTP)
#if defined(WITH_OTLP_GRPC)
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::logs::LogRecordExporter,struct std::default_delete<class opentelemetry::v1::sdk::logs::LogRecordExporter> > __cdecl opentelemetry::v1::exporter::otlp::OtlpGrpcLogRecordExporterFactory::Create(struct opentelemetry::v1::exporter::otlp::OtlpGrpcExporterOptions const & __ptr64)
?Create@OtlpGrpcLogRecordExporterFactory@otlp@exporter@v1@opentelemetry@@SA?AV?$unique_ptr@VLogRecordExporter@logs@sdk@v1@opentelemetry@@U?$default_delete@VLogRecordExporter@logs@sdk@v1@opentelemetry@@@std@@@std@@AEBUOtlpGrpcExporterOptions@2345@@Z
// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::PushMetricExporter,struct std::default_delete<class opentelemetry::v1::sdk::metrics::PushMetricExporter> > __cdecl opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporterFactory::Create(struct opentelemetry::v1::exporter::otlp::OtlpGrpcMetricExporterOptions const & __ptr64)
?Create@OtlpGrpcMetricExporterFactory@otlp@exporter@v1@opentelemetry@@SA?AV?$unique_ptr@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@U?$default_delete@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@@std@@@std@@AEBUOtlpGrpcMetricExporterOptions@2345@@Z

?GetOtlpDefaultGrpcTracesEndpoint@otlp@exporter@v1@opentelemetry@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
?GetOtlpDefaultGrpcTracesIsInsecure@otlp@exporter@v1@opentelemetry@@YA_NXZ
?GetOtlpDefaultTracesSslCertificatePath@otlp@exporter@v1@opentelemetry@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
Expand All @@ -76,5 +109,9 @@ EXPORTS
?Create@OtlpHttpLogRecordExporterFactory@otlp@exporter@v1@opentelemetry@@SA?AV?$unique_ptr@VLogRecordExporter@logs@sdk@v1@opentelemetry@@U?$default_delete@VLogRecordExporter@logs@sdk@v1@opentelemetry@@@std@@@std@@AEBUOtlpHttpLogRecordExporterOptions@2345@@Z
?GetOtlpDefaultHttpTracesEndpoint@otlp@exporter@v1@opentelemetry@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
?GetOtlpDefaultHttpLogsEndpoint@otlp@exporter@v1@opentelemetry@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ

// public: static class std::unique_ptr<class opentelemetry::v1::sdk::metrics::PushMetricExporter,struct std::default_delete<class opentelemetry::v1::sdk::metrics::PushMetricExporter> > __cdecl opentelemetry::v1::exporter::otlp::OtlpHttpMetricExporterFactory::Create(struct opentelemetry::v1::exporter::otlp::OtlpHttpMetricExporterOptions const &)
?Create@OtlpHttpMetricExporterFactory@otlp@exporter@v1@opentelemetry@@SA?AV?$unique_ptr@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@U?$default_delete@VPushMetricExporter@metrics@sdk@v1@opentelemetry@@@std@@@std@@AEBUOtlpHttpMetricExporterOptions@2345@@Z
?GetOtlpDefaultHttpMetricsEndpoint@otlp@exporter@v1@opentelemetry@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ
#endif // defined(WITH_OTLP_HTTP)
// clang-format on
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace metrics
class MetricReader;
class PushMetricExporter;

class PeriodicExportingMetricReaderFactory
class OPENTELEMETRY_EXPORT PeriodicExportingMetricReaderFactory
{
public:
static std::unique_ptr<MetricReader> Create(std::unique_ptr<PushMetricExporter> exporter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewRegistry;
/**
* Factory class for MeterContext.
*/
class MeterContextFactory
class OPENTELEMETRY_EXPORT MeterContextFactory
{
public:
/**
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 @@ -30,7 +30,7 @@ class MeterContext;
class MetricCollector;
class MetricReader;

class MeterProvider final : public opentelemetry::metrics::MeterProvider
class OPENTELEMETRY_EXPORT MeterProvider final : public opentelemetry::metrics::MeterProvider
{
public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace metrics
even if this forces, temporarily, existing applications to use a downcast.
*/

class MeterProviderFactory
class OPENTELEMETRY_EXPORT MeterProviderFactory
{
public:
static std::unique_ptr<opentelemetry::metrics::MeterProvider> Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace metrics

class InstrumentSelector;

class InstrumentSelectorFactory
class OPENTELEMETRY_EXPORT InstrumentSelectorFactory
{
public:
static std::unique_ptr<InstrumentSelector> Create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace metrics

class MeterSelector;

class MeterSelectorFactory
class OPENTELEMETRY_EXPORT MeterSelectorFactory
{
public:
static std::unique_ptr<MeterSelector> Create(opentelemetry::nostd::string_view name,
Expand Down