-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][broker][functions-worker] Ensure prometheus metrics are grouped by type (#8407, #13865) #15558
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
Conversation
|
@codelipenghui can you look at this? |
eolivelli
left a comment
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 your first contribution
while I understand the goal of this patch and I think we should address this problem, we must find a better way to reduce memory allocations and the amount of memory we are using while generating metrics.
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/TopicStats.java
Outdated
Show resolved
Hide resolved
|
@eolivelli could you please approve the workflows and review again |
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
|
/pulsarbot run cpp-tests |
...rc/main/java/org/apache/pulsar/broker/stats/prometheus/metrics/PrometheusTextFormatUtil.java
Outdated
Show resolved
Hide resolved
I agree absolutely, there are over 190 commits included in 2.10.2. |
|
@michaeljmarshall - DataDog seems to expect the prometheus metrics to be grouped together by name, this is usually under a |
… by type (apache#8407, apache#13865) (apache#15558) Co-authored-by: Dave Maughan <davidamaughan@gmail.com>
|
Thanks for clarifying @marksilcox. I misunderstood the initial issue. This seems like a bug fix, not an improvement @eolivelli. |
|
Hello @marksilcox |
|
@mattisonchao created #17618 to merge into branch-2.9. Is similar needed for branch-2.10? |
@marksilcox This PR does need to cherry-pick to branch-2.10. |
|
I move this to 2.10.4. If you have any questions, feel free to ping me. |
|
Just want to remind everyone that when a new PR was created to cherry-pick it from master to 2.9, a memory leak was introduced since the 2.9 metrics implementation is different a bit from the master branch. So we need to double-check that. See memory leak fixed |
|
@liangyepianzhou I've created #18941 to merge into branch-2.10. |
|
#17419 relies on this, so cherry-picked to branch-2.11 |
Fixes #8407
Fixes #13865
Motivation
Current broker prometheus metrics are not grouped by metric type which causes issues in systems that read these metrics (e.g. DataDog).
Prometheus docs states "All lines for a given metric must be provided as one single group" - https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md#grouping-and-sorting
Modifications
Updated the namespace and topic prometheus metric generators to group the metrics under the appropriate type header.
Updated function worker stats to include TYPE headers
Verifying this change
This change added tests and can be verified as follows:
Added unit test to verify all metrics are grouped under correct type header
Does this pull request potentially affect one of the following parts:
Documentation
Need to update docs?
doc-not-neededChanges to match prometheus spec