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

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

Open
LarryOsterman opened this issue Feb 10, 2024 · 3 comments
Open

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

LarryOsterman opened this issue Feb 10, 2024 · 3 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@LarryOsterman
Copy link

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

@LarryOsterman LarryOsterman added the bug Something isn't working label Feb 10, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 10, 2024
@ThomsonTan ThomsonTan removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 12, 2024
@ThomsonTan ThomsonTan self-assigned this Feb 12, 2024
@willie
Copy link
Contributor

willie commented Feb 27, 2024

This has downstream effects, too, as I had the same problem using the downstream vcpkg package for open-telemetry and had to find and link the previously mentioned libraries.

However, unlike @LarryOsterman, I did not have to use find_package(gRPC) as I was only using the otlp-http feature in that port.

@LarryOsterman
Copy link
Author

This has downstream effects, too, as I had the same problem using the downstream vcpkg package for open-telemetry and had to find and link the previously mentioned libraries.

However, unlike @LarryOsterman, I did not have to use find_package(gRPC) as I was only using the otlp-http feature in that port.

I discovered after filing this that the gRPC dependency was fixed in the OTLP port a couple of months ago. At the time I filed the bug, my repo was using a vcpkg baseline from November which had that issue. But the other dependencies (protobuf, nlohmann_json, and curl) are still needed.

Copy link

This issue was marked as stale due to lack of activity.

@github-actions github-actions bot added the Stale label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

3 participants