-
Notifications
You must be signed in to change notification settings - Fork 501
Open
Labels
bugSomething isn't workingSomething isn't workingtriage/needs-informationIndicates an issue needs more information in order to work on it.Indicates an issue needs more information in order to work on it.
Description
Describe your environment
WSL -> Ubuntu 20.04.6 LTS
gcc version 9.4.0
Steps to reproduce
Vcpkg manifest:
{
"dependencies": [
{
"name": "opentelemetry-cpp",
"features": [
"otlp-grpc"
],
"version>=" : "1.19.0"
}
],
"builtin-baseline": "1f3f10d4911f46339411e12b1d0947c22bad5937"
}
CMakeLists.txt
find_package(opentelemetry-cpp CONFIG REQUIRED COMPONENTS)
add_executable(otlpgrpcmain
./src/otlpgrpcmain.cpp
)
target_link_libraries(otlpgrpcmain
opentelemetry-cpp::otlp_grpc_metrics_exporter
)
Simple sample app:
#include "opentelemetry/exporters/otlp/otlp_grpc_metric_exporter_factory.h"
#include "opentelemetry/metrics/provider.h"
#include "opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader.h"
#include "opentelemetry/sdk/metrics/meter_provider.h"
namespace otlp_exporter = opentelemetry::exporter::otlp;
namespace metrics_api = opentelemetry::metrics;
namespace metrics_sdk = opentelemetry::sdk::metrics;
int main(int argc, char** argv)
{
std::shared_ptr<metrics_api::MeterProvider> apiProvider;
otlp_exporter::OtlpGrpcMetricExporterOptions options;
options.endpoint = "collector-endpoint:4317";
std::unique_ptr<metrics_sdk::PushMetricExporter> exporter = otlp_exporter::OtlpGrpcMetricExporterFactory::Create(options);
// Initialize and set the MeterProvider
metrics_sdk::PeriodicExportingMetricReaderOptions reader_options;
std::unique_ptr<metrics_sdk::MetricReader> reader = std::make_unique<metrics_sdk::PeriodicExportingMetricReader>(std::move(exporter), reader_options);
apiProvider = std::make_shared<metrics_sdk::MeterProvider>();
auto sdkProvider = std::static_pointer_cast<metrics_sdk::MeterProvider>(apiProvider);
sdkProvider->AddMetricReader(std::move(reader));
return 0;
}
What is the expected behavior?
Expect to compile and link succesfully
What is the actual behavior?
Linker error:
[100%] Linking CXX executable otlpgrpcmain
/usr/bin/ld: vcpkg_installed/x64-linux/debug/lib/libabsl_status.a(status.cc.o):(.rodata+0x320): multiple definition of `absl::lts_20240722::Status::kMovedFromString'; vcpkg_installed/x64-linux/debug/lib/libgrpc.a(client_channel_service_config.cc.o):(.rodata._ZN4absl12lts_202407226Status16kMovedFromStringE[_ZN4absl12lts_202407226Status16kMovedFromStringE]+0x0): first defined here
collect2: error: ld returned 1 exit status
Additional context
N/A
ThomsonTan and dbarker
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriage/needs-informationIndicates an issue needs more information in order to work on it.Indicates an issue needs more information in order to work on it.