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

Implementing configurable aggregation cardinality limit and collector emitting all views instead of last view #3299

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

PradSenn
Copy link

@PradSenn PradSenn commented Mar 12, 2025

Fixes #3292
Cardinality of the Aggregation limit (2000) is hardcoded and no ability to configure as part of the meter/aggregation.

Meter stores meter-name to storage in storage_registry_. When multiple views are added, the last view overrides the previous view, and collector can only emit the last view's metrics that are added.

Changes

Please provide a brief description of the changes here.

Introducing cardinality as configurable parameter in AggregationConfig, and implementing the limit from AggregationConfig in Storage.

Changing the storage_registry_ to keep track of view_name to storage, instead of metric_name to storage. So when multiple views are added, different view-names will be collected by collector. Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

… emitting all views instead of last view

Issues

Cardinality of the Aggregation limit (2000) is hardcoded and no ability to configure as part of the meter/aggregation
Meter stores meter-name to storage in storage_registry_. When multiple views are added, the last view overrides the previous view, and collector can only emit the last view's metrics that are added.

Fixes
Introducing cardinality as configurable parameter in AggregationConfig, and implementing the limit from AggregationConfig in Storage
Changing the storage_registry_ to keep track of view_name to storage, instead of metric_name to storage. So when multiple views are added, different view-names will be collected by collector.
Please provide a brief description of the changes here.
@PradSenn PradSenn requested a review from a team as a code owner March 12, 2025 00:47
Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit 491ef3c
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67d1be82c380380008c11d3f

@lalitb lalitb self-assigned this Mar 12, 2025
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.53%. Comparing base (148cfe9) to head (491ef3c).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3299      +/-   ##
==========================================
+ Coverage   89.48%   89.53%   +0.06%     
==========================================
  Files         208      208              
  Lines        6497     6500       +3     
==========================================
+ Hits         5813     5819       +6     
+ Misses        684      681       -3     
Files with missing lines Coverage Δ
...metry/sdk/metrics/aggregation/aggregation_config.h 100.00% <100.00%> (ø)
sdk/include/opentelemetry/sdk/metrics/meter.h 57.15% <ø> (ø)
...telemetry/sdk/metrics/state/async_metric_storage.h 94.60% <100.00%> (ø)
...entelemetry/sdk/metrics/state/attributes_hashmap.h 97.02% <100.00%> (+4.71%) ⬆️
...ntelemetry/sdk/metrics/state/sync_metric_storage.h 86.37% <100.00%> (ø)
sdk/src/metrics/meter.cc 82.50% <100.00%> (ø)
sdk/src/metrics/state/sync_metric_storage.cc 100.00% <100.00%> (ø)
sdk/src/metrics/state/temporal_metric_storage.cc 97.37% <100.00%> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

[Metrics SDK] Make cardinality limit configurable
2 participants