-
Notifications
You must be signed in to change notification settings - Fork 423
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
[EXPORTER] prometheus: add otel_scope_name and otel_scope_version labels #2293
[EXPORTER] prometheus: add otel_scope_name and otel_scope_version labels #2293
Conversation
232617f
to
212071b
Compare
Codecov Report
@@ Coverage Diff @@
## main #2293 +/- ##
=======================================
Coverage 87.39% 87.39%
=======================================
Files 199 199
Lines 6009 6009
=======================================
Hits 5251 5251
Misses 758 758 |
6f7795f
to
58afc94
Compare
Any pointers on what this might be? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT: I was wrong about this. There is an implicit conversion to std::string. I am not sure what will happen in the case where OTel uses the standard library though.
Also, maybe related, this part of the implementation is error prone:
opentelemetry-cpp/sdk/include/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h
Line 140 in cdbc90a
: name_(name), version_(version), schema_url_(schema_url), attributes_(std::move(attributes)) |
This assumes that the string_view
s are null-terminated, which might not be the case. I can send a PR to fix it.
bdcb870
to
4fe16cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to see the CI pass, you could steal the changes from #2301
const opentelemetry::sdk::instrumentationscope::InstrumentationScope *scope_; |
Basically make this
const opentelemetry::sdk::instrumentationscope::InstrumentationScope *scope_ = nullptr;
fbfc0c4
to
49946cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried for an hour to get this to work. I am giving up. Here are some code nits for you:
This comment was marked as resolved.
This comment was marked as resolved.
fdcaa01
to
1e5f6c5
Compare
1e5f6c5
to
d9a8159
Compare
c178713
to
850dfc4
Compare
Please merge with a recent main, to resolve the conflicts. |
079f37a
to
afa9009
Compare
@marcalff done |
I'm happy to wait and rebase my PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
Part of #1841
Changes
From https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1:
This adds the otel_scope_name and otel_scope_version labels to all metrics, if they are non-empty.