snehavats1404 opened a new pull request, #2870: URL: https://github.com/apache/brpc/pull/2870
### What problem does this PR solve? Issue Number: #2885 Problem Summary: The issue pertains to incorrectly tracking and emitting metric names when dumping Prometheus metrics. Some metrics, especially those related to latency, were not being properly emitted due to incorrect handling of the `emitted_metrics` set. ### What is changed and the side effects? Changed: - Fixed the logic for tracking emitted metrics by using a set to ensure that duplicate metrics are not emitted. - Ensured that all necessary latency percentiles and summary metrics are properly output, with correct handling of the `_latency_*` and `_count` suffixes. - Added a mechanism to track previously emitted metric names to prevent duplication in Prometheus output. Side effects: - **Performance effects**: The introduction of a set to track emitted metrics could slightly impact performance, but this change ensures more efficient handling of duplicate metrics. - **Breaking backward compatibility**: No breaking changes; existing behavior should remain intact except for the fix to prevent duplicate metric emission. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
