-
Notifications
You must be signed in to change notification settings - Fork 2.7k
implement cardinality limit for spanmetrics #38990
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
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I can work on it. |
What's the value 5 means for |
I have another perspective on handling high cardinality labelsets for span metrics. While I believe that cardinality limit protections are a good idea, there might be more suitable tools for addressing this issue, such as the Transform Processor. Perhaps we should also consider removing the meaningless parts of the span? |
This line indicates there were 5 additional requests beyond the cardinality limit, thus grouped together without distinct request_id.
Do you mean implementing this logic at the config level using the
I'm not sure about this. Depending on the user settings, the information used for creating the metrics will vary, right? Like the dimensions to use. Something that we can understand as "meaningless" for us can be important for the user environment. Or are you proposing something different? |
Personally I think OTEL SDKS cardinality are on the SDK level, because they protect the application of not using too much memory. I.E. I create a metric that has uuid in attribute value, applications memory will explode. If we do it in transform processor, IMO it is a bit too late, since in spanmetrics we already created a bunch of cummulative time series and the memory has exploded. My proposal would be to first do it here, then maybe package it up and do some kind of generic mechanism for metric data producers. |
I personally support this feature, and we need to apply a cardinality limit to all metrics emitted by spanmetrics |
#39084) Fixes #38990 Signed-off-by: Israel Blancas <[email protected]>
Component(s)
connector/spanmetrics
Is your feature request related to a problem? Please describe.
It's very easy for instrumentations to incidentally put uuid / unique urls into span name, which causes spanmetrics to create high cardinality metrics.
I would like to have Cardinality limit protections similar to what are available in otel SDKS (https://opentelemetry.io/docs/specs/otel/metrics/sdk/#cardinality-limits)
Describe the solution you'd like
Ideally some disabled by default or feature flagged
aggregation_cardinality_limit
field, which would limit metric cardinality.This limit should be applied per unique resource.
I.e if I have two applications, that send spans, and only one application sends spans with uuids, only those metrics should be limited.
Additionally to make it similar to OTEL Metric SDK Cardinality limit, each metric should get it's own limit. I.e.
calls_total
has it's limit alsoduration_bucket_ms
has it's limit.so the limit is per resource per metric.
Metrics limited by cardinality limit should get all the resource attributes kept, but dimensions (span.name, span.status_code, etc) should be limited instead of dimensions you would get
otel.metric.overflow="true"
attribute.Example how golang sdk works:
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: