-
Notifications
You must be signed in to change notification settings - Fork 7
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 #51
Conversation
20ca9fa
to
f1fbf1d
Compare
f1fbf1d
to
efe0622
Compare
from ..objectives import Objective | ||
|
||
|
||
prometheus_client.REGISTRY.unregister(prometheus_client.GC_COLLECTOR) |
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.
could you add a comment explaining these unregister calls? was this something we should've been doing all along?
not sure if this is what you read, but this thread seemed relevant
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.
my bad, i set that when i was debugging exemplars but forgor 💀 to remove it. we probably shouldn't set these in autometrics.
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.
tested with your example + the modified version of quickmetrics! works like a charm
only change i'd request is a comment explaining the logic of unregistering some of the default collectors
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.
👍 nice!
README.md
Outdated
@@ -130,6 +134,15 @@ The `version` is read from the `AUTOMETRICS_VERSION` environment variable, and t | |||
|
|||
This follows the method outlined in [Exposing the software version to Prometheus](https://www.robustperception.io/exposing-the-software-version-to-prometheus/). | |||
|
|||
## Exemplars | |||
|
|||
> **NOTE** - As of writing, aren't supported by the default tracker (`AUTOMETRICS_TRACKER=OPEN_TELEMETRY`). |
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 think the word exemplars
is missing here:
As of writing, exemplars aren't supported...
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 was also thinking that maybe it's better to first explain what exemplars are before mentioning the limitations/caveats
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.
good eye! indeed, the word was missing - fixed now
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.
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.
It makes more sense to me to explain first and then mention what the caveats are especially if people aren't super familiar with what exemplars are even if you can skip, notes are typically important so for me (personally) I would still try to read it first., but that's just anecdotal (and also I don't feel that strongly about it) so i'm fine with leaving it the way you have it now.
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.
self.__count(function, module, caller, objective, result) | ||
self.__histogram(function, module, start_time, objective) | ||
exemplar = None | ||
# Currently, exemplars are only supported by prometheus-client |
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 think it might be good to keep an issue open for this. So we can refer to it from our source code and also have a place to talk about how to deal/resolve this
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.
we actually have one! i added a backlink there and also linked the issue from code
efe0622
to
4ae9fb5
Compare
i also updated the example to show we track exemplars for all autometrized functions inside the span, a la rust version |
016c8fe
to
4e83474
Compare
4e83474
to
73e2037
Compare
No description provided.