-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unexpected behavior of And policy #29637
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
The issue is related to the two parts of code: In the first version config, the non- In the second version config, the non- |
I don't quite understand the purpose to differentiate |
typically, invert match is used to exclude small parts of data that user don't want to see it. For example, when using invert match to exclude health check trace:
Well if I think this may be an unavoidable trade-off where there will always be a configuration layout that needs to compromise. In your case, I modified the configuration to make it more symmetry: tail_sampling:
policies:
- name: policy-for-other-service
type: and
and:
and_sub_policy:
- name: define-other-service
type: string_attribute
string_attribute:
invert_match: true
key: service.name
values:
- foo
# the following part is omitted in your config, I add it here for comprehensive.
- name: real-policy
type: always_sample
- name: policy-for-foo-service
type: and
and:
and_sub_policy:
- name: define-foo-service
type: string_attribute
string_attribute:
key: service.name
values:
- foo
- name: real-policy
type: string_attribute
string_attribute:
invert_match: true
key: http.route
values:
- /actuator/health/** Now it looks neat. I understand that it's complicated; however, if the behavior of Me personally suggestion (put on my end-user hat):
|
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
processor/tailsampling
What happened?
Description
I tried to use the
tailsampling
processor to drop the health check traces of a particular service (let's name isfoo
here), but the behavior of theAnd
policy was out of my expectation.Steps to Reproduce
The first version of config:
It worked as I expected, excluding all traces with
http.route=/actuator/health/**
of servicefoo
.Then I thought maybe I could simplify the config a bit, as below:
The only change was moving the sub policy of
And
to the top level.Then I found that other traces with
http.route
not equal to/actuator/health/**
of servicefoo
were dropped too.Expected Result
Moving the only one sub policy of
And
to the top level should not change its behavior.Actual Result
The policy behavior is changed
Collector version
0.79.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: