-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Pre-render prometheus labels #3587
Pre-render prometheus labels #3587
Conversation
Oh, that's a nice improvement indeed! |
@pjk25 self reminder to fixup the bazel commit |
@binarin |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
e11fb80
to
6641c5a
Compare
@binarin I think this is looking good now |
This makes per-object metrics twice as fast. Depends on deadtrickster/prometheus.erl#137
f6c317d
to
8598c51
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 can confirm 20-50% reduction in response latency (the number of samples is small but the results are consistent).
…timization Pre-render prometheus labels (cherry picked from commit 1b7a8f8) Conflicts: rabbitmq-components.mk workspace_helpers.bzl
Backported to |
Proposed Changes
Pre-render labels for prometheus exported. Character escaping is not needed, as AMQP object names are quite restricted in what characters they can have.
Doing it this way removes not only CPU overhead, but also a lot of garbage collection overhead (as for every output line labels were converted from a proplist to a list of records before rendering).
This makes per-object metrics twice as fast, time to produce ~630k metrics (10k queues/10k consumer/10k producers) went from ~6 to ~3 seconds from this change.
Depends on deadtrickster/prometheus.erl#137
This also pulls an performance optimization deadtrickster/prometheus.erl#136 - across all those changes on my test machine I saw scraping time dropping 40 times for the aforementioned 630k metrics.
Testing was performed by running 2 instances of perftest with the following arguments (just with a slightly modified queue pattern each time):
2 instances because perftest was running out of memory, and running two instances was easier for me than learning how to tune java memory settings.
The timing of following urls are of special interest for testing:
Types of Changes
Checklist
CONTRIBUTING.md
document