Skip to content
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

Metrics Cardinality Reduction: PoC #4843

Closed

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented May 20, 2022

Cover letter

This is a PoC of filtering existing metrics with the following features:

  • config struct
  • filtering of existing metrics from config
  • aggregation of over labels from config by:
    • sum
    • count
    • min
    • max
    • avg
  • Some tests

From the code that exists it has some weaknesses:

  • Error handling
  • Metric types other than counter
  • non-sharded
  • Dynamic Labels
  • Probably lots more missing.

Release notes

  • none

Signed-off-by: Ben Pope <ben@redpanda.com>

// Collect aggregated instances
metric_multi_instance new_instances;
for (const auto& [base_labels, base_metric] : family) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an efficiency issue here for large partition counts: we'd be iterating over ~10E5 partition labels and summing them all up, plus the allocation overhead of building these intermediate vectors of metrics.

Copy link
Member Author

@BenPope BenPope May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two phases:

  • This code that allocates runs at (re)configuration time, and can be made async if required.
  • The aggregations happens at scrape time, and would indeed involve iteration and indirection.

@BenPope
Copy link
Member Author

BenPope commented Jun 24, 2022

Decided on a different direction: #5166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants