-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[processor/tailsamplingprocessor] config allows duplicate policy names resulting in metrics collision #26726
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Although the sub-policies in |
Enforcing policy names to be unique sounds like a reasonable solution to this. I think we would need to gradually roll this out with a feature gate because it could be a breaking change for existing configurations. |
@jpkrohling what do you think? Could there be another option that is less impactful to existing configurations? |
At the time, the only alternative solution I could think of was to append a suffix to duplicate policy names (determined by the policies position in the list) when the configuration is initially loaded into memory. So for the following:
You could choose from either of these approaches:
Existing configurations would still work, although with a reduced emphasis on correctness. One potential drawback I can see to this approach is that if users were to add yet another policy with the same name to an existing configuration, the exported names of policies could potentially change depending on where they position the new policy in the list. But I'd hope at that stage they would fix the issue of having duplicate names. |
Marking as closed as covered by #27016 |
Component(s)
processor/tailsampling
What happened?
Description
As noted in: #25882 (comment)
The name of each sampling policy is attached to the
count_traces_sampled
metric as an attribute which records how many traces each policy is responsible for sampling.If a user provides two policies with identical names then a collision occurs and the counts for the two policies are combined and reported under one metric.
Steps to Reproduce
Given any two or more policies with identical names:
The
count_traces_sampled
metric will report a combined count of both policies:Suggested fix
Expected Result
Config validation checks each sampling policy's name is unique and returns an error, preventing the collector from starting.
Actual Result
Collector starts.
Collector version
v0.85.0
Environment information
Environment
OS: Mac OS Ventura 13.5.2 (22G91)
Compiler(if manually compiled): go version go1.21.1 darwin/arm64
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: