Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Make Labels Optional for CounterMetric::add #1032
Make Labels Optional for CounterMetric::add #1032
Changes from 7 commits
2cb9dae
abf279c
0c4c82b
276fedf
fb000c1
9928ba7
15a1cf7
649a4b8
d12dbda
38cb3a9
ffd2593
daa44cd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is nice, it would be nice if you can do the same thing to
measure.record
(https://github.com/astorm/opentelemetry-js/blob/astorm/labels-optional/packages/opentelemetry-metrics/src/Metric.ts#L166)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.
Just realized, Prometheus exporter would fail after this change. Especially below line due to
toString
method onundefined
:opentelemetry-js/packages/opentelemetry-exporter-prometheus/src/prometheus.ts
Line 187 in c454d6c
I would prefer to fix it in this same PR and do some end to end manual testing. WDYT?
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.
Also, in order to pass the build you need to make the same change in the API package.
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.
Thanks for the guidance and patience @mayurkale22 -- I'm new to the repo and the project and I'm still getting my sea legs.
Fixing this for the
MeasureMetric
in this PR makes sense. Fixing the prometheus exporter in this PR also makes sense. I presume the change inopentelemetry-api
would be to the interfaces, and that also makes sense to do in this PR.I'll ping -- you? -- via a PR comment when that's done. If there's more to The Process™ please let me know.
Best wishes.
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.
SGTM, just add a comment on this thread when new changes are ready to review. I usually use this example to test against prom. exporter.
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.
@mayurkale22 not sure why you think the prometheus exporter would fail on that line. Can you explain? I'm hesitant to approve changes to the
_registerMetric
routine in the prometheus exporter because the prom-client has some surprising behavior, and that is the logic we use to destroy and recreate the counters with the new values.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.
Looks like @astorm already mention the reason, here-> #1032 (comment) (due to
toString
method onundefined
label value).I would suggest to add new test in prom. exporter with some
LabelKeys
but w/oLabels
(values). You can reuse existing test (like this one), just dont bind the labels to metric.