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

Prometheus exporter gives build error #1728

Closed
rgc183 opened this issue Nov 1, 2022 · 3 comments · Fixed by #1795
Closed

Prometheus exporter gives build error #1728

rgc183 opened this issue Nov 1, 2022 · 3 comments · Fixed by #1795
Labels
bug Something isn't working

Comments

@rgc183
Copy link

rgc183 commented Nov 1, 2022

I am using bazel build in my project by following steps mentioned here: https://github.com/open-telemetry/opentelemetry-cpp/blob/main/INSTALL.md#incorporating-into-an-existing-bazel-project

Now, I try to use prometheus exporter in my project using:

deps = [ "@io_opentelemetry_cpp//api", "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter", "@io_opentelemetry_cpp//sdk:headers", "@io_opentelemetry_cpp//sdk/src/metrics" ],

which causes an error:

/root/.cache/bazel/_bazel_root/e6fb20bb08e42b93349ca637dd380aaf/external/com_github_jupp0r_prometheus_cpp/pull/BUILD.bazel:9:11: no such package '@civetweb//': The repository '@civetweb' could not be resolved and referenced by '@com_github_jupp0r_prometheus_cpp//pull:pull'
Now I did some digging and I found that prometheus is being included this way: https://github.com/open-telemetry/opentelemetry-cpp/blob/main/bazel/repository.bzl#L111

And "@io_opentelemetry_cpp//exporters/prometheus:prometheus_exporter", -> this is leading to https://github.com/open-telemetry/opentelemetry-cpp/blob/main/exporters/prometheus/BUILD#L104 where it only calls pull and core directories. However, civetweb is actually built in https://github.com/open-telemetry/opentelemetry-cpp/blob/main/WORKSPACE#L25 and call to this is missing in repository.bzl

However, https://github.com/open-telemetry/opentelemetry-cpp/tree/main/examples/prometheus this builds fine since WORKSPACE calls dependency function.

@rgc183 rgc183 added the bug Something isn't working label Nov 1, 2022
@rgc183
Copy link
Author

rgc183 commented Nov 2, 2022

@lalitb

@rgc183
Copy link
Author

rgc183 commented Nov 2, 2022

I created local fix here: main...rgc183:opentelemetry-cpp:bazel_fix

@owent
Copy link
Member

owent commented Nov 2, 2022

It looks good, could you please raise a PR and rename.
Just a suggestion, is it better to rename load_extra_deps to opentelemetry_extra_deps ? Just like grpc_extra_deps

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
2 participants