-
Notifications
You must be signed in to change notification settings - Fork 580
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
Add exemplar support to histogram (and histogram part of timer) Prometheus output #2912
Conversation
…cluding the new shared page
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.
Hi Tim - I ran into a couple of 'no newline' warnings. I'm not sure if they impact anything when merging.
metrics/metrics/src/main/java/io/helidon/metrics/ExemplarService.java
Outdated
Show resolved
Hide resolved
examples/metrics/exemplar/src/main/java/io/helidon/examples/metrics/exemplar/package-info.java
Show resolved
Hide resolved
metrics/trace-exemplar/src/main/resources/META-INF/services/io.helidon.metrics.ExemplarService
Outdated
Show resolved
Hide resolved
@ljamen The no-newline-at-end warnings are from GitHub, not from our build's style checker which insists on newlines at the end of only certain types of files. The clean pipeline builds we see with these files as-is indicate these are OK but I'll change those just in case given I'm fixing some things in other files. |
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
examples/metrics/exemplar/src/main/resources/META-INF/native-image/reflect-config.json
Outdated
Show resolved
Hide resolved
metrics/metrics/src/main/java/io/helidon/metrics/ExemplarServiceManager.java
Show resolved
Hide resolved
metrics/metrics/src/test/java/io/helidon/metrics/TestNearestValueSearch.java
Outdated
Show resolved
Hide resolved
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
Resolves #2797.
Main changes:
metrics/metrics
:Sample
(value, label, timestamp instead of only a value) for each observation in a histogram data set, for the most recent counter update, and for the most recent simple timer update.ExemplarServiceManager
which uses theServiceLoader
mechanism to load all implementations of the newExemplarService
, if any, ordered by the@Priority
annotation on the implementing classes. Helidon Metrics uses the selected implementations to get label(s) to be stored with each sample. If theServiceLoader
finds no such service, the manager uses a simple default implementation that always returns an empty string.metrics/trace-examplar
which supplies anExemplarService
implementation that supplies the current trace ID as the label.metrics
for this feature.To trigger this behavior, users add a dependency on the new
metrics/trace-examplar
artifact and also add a dependency on the Helidon Zipkin or Jaeger integration.Alternatively, a developer could provide a custom implementation of
ExemplarService
instead of the one inmetrics/trace-exemplar
.