Implement histogram cardinality reduction#868
Merged
xiaoxichen merged 2 commits intoeBay:masterfrom Mar 11, 2026
Merged
Conversation
54835d2 to
254bd3d
Compare
Convert 19 internal histogram metrics to sum/count mode in production builds while preserving full histograms in debug builds, reducing Prometheus cardinality by ~79% (17,000 -> 3,695 time series). Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
254bd3d to
1386888
Compare
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #868 +/- ##
==========================================
- Coverage 56.51% 48.24% -8.27%
==========================================
Files 108 110 +2
Lines 10300 12877 +2577
Branches 1402 6180 +4778
==========================================
+ Hits 5821 6213 +392
+ Misses 3894 2567 -1327
- Partials 585 4097 +3512 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
szmyd
requested changes
Mar 10, 2026
Collaborator
szmyd
left a comment
There was a problem hiding this comment.
Can we do something about:
#ifdef _PRERELEASE
REGISTER_HISTOGRAM(metric_name, "Description", ...); // Full histogram in debug
#else
REGISTER_HISTOGRAM(metric_name, "Description", ..., _publish_as::publish_as_sum_count); // Sum/count in production
#endifEven if that means doing something akin to:
homestore_metrics.hpp:
...
#define REGISTER_HS_HISTOGRAM(metric_name, ...) \
#ifdef _PRERELEASE
... // you get the pointdd5eed6 to
2dd92ae
Compare
2dd92ae to
d2c996e
Compare
Add REGISTER_HISTOGRAM_WITH_CARDINALITY_REDUCTION macro to eliminate repetitive #ifdef _PRERELEASE blocks around histogram registrations. Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
d2c996e to
cf27c4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Convert 19 internal histogram metrics to sum/count mode in production builds while preserving full histograms in debug builds, reducing Prometheus cardinality by ~79% (17,000 -> 3,695 time series).