Skip to content

OTLP Exporter cmake documentation is missing some steps... #2528

@LarryOsterman

Description

@LarryOsterman

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.

  1. 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"]
   },
  1. 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 :(.

  1. 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).

Metadata

Metadata

Assignees

Labels

StalebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions