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] Build break when using WITH_OTLP_HTTP=ON, WITH_OTLP_GRPC=OFF #1826

Closed
marcalff opened this issue Dec 1, 2022 · 5 comments · Fixed by #1829
Closed

[Build] Build break when using WITH_OTLP_HTTP=ON, WITH_OTLP_GRPC=OFF #1826

marcalff opened this issue Dec 1, 2022 · 5 comments · Fixed by #1829
Assignees
Labels
bug Something isn't working

Comments

@marcalff
Copy link
Member

marcalff commented Dec 1, 2022

When compiling with the OTLP HTTP exporter but not the OTLP GRPC exporter,
the build fails:

In file included from .../opentelemetry-cpp/opentelemetry-cpp-1.8.0/exporters/otlp/src/otlp_grpc_utils.cc:4:
.../opentelemetry-cpp/opentelemetry-cpp-1.8.0/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_utils.h:6:10: fatal error: grpcpp/grpcpp.h: No such file or directory
    6 | #include <grpcpp/grpcpp.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

Suggested fix for exporter/otlp/CMakeLists.txt:

  • do not add otlp_grpc_utils.cc in the opentelemetry_otlp_recordable library
  • add otlp_grpc_utils.cc in the opentelemetry_exporter_otlp_grpc library instead ? (to investigate)
@marcalff marcalff added the bug Something isn't working label Dec 1, 2022
@marcalff
Copy link
Member Author

marcalff commented Dec 1, 2022

@ThomsonTan

If I understand correctly, file src/otlp_grpc_utils.cc should not be in library opentelemetry_otlp_recordable.

Now the question remains to decide in which library to add file src/otlp_grpc_utils.cc instead:

  • opentelemetry_exporter_otlp_grpc_client ?
  • opentelemetry_exporter_otlp_grpc ? (trace specific, so probably not)
  • opentelemetry_exporter_otlp_grpc_log ? (logs specific, so probably not)
  • opentelemetry_exporter_otlp_grpc_metrics ? (metrics specific, so probably not)
  • other new library for common GRPC code ?

Please advise on how to fix this.

@sirzooro
Copy link

sirzooro commented Dec 1, 2022

What about compiling this file only when WITH_OTLP_GRPC=ON? It could stay in opentelemetry_otlp_recordable lib.

Edit: you can also wrap contents of this file in something like #ifdef WITH_OTLP_GRPC, so during compilation with WITH_OTLP_GRPC=OFF file would be empty for compiler.

@esigo
Copy link
Member

esigo commented Dec 1, 2022

@ThomsonTan
Copy link
Contributor

For bazel build, the new util code goes to a separate new lib, probably we could do the same for CMake? opentelemetry_exporter_otlp_grpc_client looks another acceptable place.

https://github.com/open-telemetry/opentelemetry-cpp/blob/main/exporters/otlp/BUILD#L50

@lalitb
Copy link
Member

lalitb commented Dec 1, 2022

Have raised a PR by adding it to opentelemetry_exporter_otlp_grpc_client, it can be separate library too. I don't have strong preference for either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants