-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Change prometheus to not aggregate metrics and only export them. #385
Change prometheus to not aggregate metrics and only export them. #385
Conversation
Measures are being exported as summaries since histograms doesn't exist on OpenTelemetry yet. Better error handling must be done.
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 believe there's a synchronization issue here--I think it can be addressed by simply copying the checkpoint set.
I also am still pushing for a new kind of "pull" controller (which may be dedicated to Prometheus only) that would call Collect()
on demand as I think it will make the synchronization more natural and address the need to reset some state, discussed below.
That said, I would be happy to approve this and work on the remaining issues in a future PR.
remove WIP from title if ready for review. |
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.
couple of minor comments. LGTM otherwise.
exporter/metric/test/test.go
Outdated
_ = gagg.Update(ctx, createNumber(desc, v), desc) | ||
gagg.Checkpoint(ctx, desc) | ||
p.Add(desc, gagg, labels...) | ||
if agg != gagg { |
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.
Can you add a comment about this new test support?
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.
Sure, this was a little bit enigmatic. I've refactored it a bit and added some docs.
@lizthegrey are you satisfied with the changes? @jmacd yesterday you had mentioned that you were going to look at this PR one more time. Do you have additional comments? |
I just wanted to make sure I understood the test changes (and I do). Thanks @paivagustavo! |
Closes #370
What does this changes?
There is an obvious improvement to be done here in the error handling part.
With this changes, The
Export(_ context.Context, checkpointSet export.CheckpointSet)
only stores the lastcheckpointSet
and defer the exporting to when the prometheus http handler is called.Initially I thought about a bigger change, using a pull controller that would aggregate data when this handler is activated, but that could make the export operation slower.
The decision here was between two types of exporters:
Controller.Tick
s)I've chosen the later to have a more consistent and ligther operation when exporting data. After further analyses of the OpenCensus they also do it this way.
I've also changed the
test.CheckpointSet
to accept Add several metrics with the same name and label set, this would batch them just like adefaultkeys.Batcher
to proper tests summaries/histogram since Prometheus doesn't aggregate them anymore.