-
Notifications
You must be signed in to change notification settings - Fork 509
Closed
Labels
Description
There are a couple of issues in how the OTLP exporters are documented in the opentelemetry-cpp repo.
They're scattered in a number of places, so I'm dropping them in a single issue, sorry about that.
- OTLP exporters are not included in the default opentelemetry-cpp package, instead they are optional features. To enable an OTLP exporter, you need to modify your vcpkg manifest as follows:
{
"name": "opentelemetry-cpp",
"features": ["otlp"]
},- OTLP support using an opentelemetry exporter is only enabled if you update your cmakelists.txt to include the following:
target_link_libraries(myapplication
PRIVATE
opentelemetry-cpp::ostream_span_exporter
opentelemetry-cpp::in_memory_span_exporter
opentelemetry-cpp::otlp_http_exporter
opentelemetry-cpp::sdk
)
For exporters, the critical value is otlp_http_exporter. None of these fields appear to be documented :(.
- Finally, once you add otlp_http_exporter to the list of link libraries, there are a number of packages which need to be added to your configuration to make things link:
find_package(opentelemetry-cpp CONFIG REQUIRED)
find_package(protobuf)
find_package(nlohmann_json)
find_package(CURL)
find_package(gRPC)
With these modifications, I was able to successfully incorporate the OTLP Http exporter into my application, but figuring out the magic incantations took several hours. It would be nice if they were included in the documentation for the HTTP exporter (and the other exporters).
willielmolkova, dufferzafar, willie and alanwest