-
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
[processor/tailsamplingprocessor] and
policy appears to ignore string_attribute
match results
#9553
Comments
@mottibec, I'm not able to take a look at this for a couple of months, would you be able to take a look? |
Hey @tillig, unfortunately, the |
OOOOOH that makes sense, then. Might be good to include that in the README somewhere, it had me totally stumped. I'll switch to this and see how she goes. Thanks! |
It appears negative lookahead is not supported, either. I tried using
Looks like I may be stuck until the - name: keep_sampled_success
type: and
and:
and_sub_policy:
- name: drop_noisy_traces_url
type: string_attribute
string_attribute:
key: http.url
values:
- (?!\/metrics)
enabled_regex_matching: true
- name: keep_percentage
type: probabilistic
probabilistic:
sampling_percentage: 10 |
Sadly the go regex engine does not support negative lookahead. 😄 |
…ch (open-telemetry#9768) * [processor/tailsamplingprocessor] and support for string invert * Add open-telemetry#9553 to changelog.
Describe the bug
Given a tailsamplingprocessor with an
and
policy that has bothstring_attribute
andprobabilistic
sampling, theand
policy appears to ignore the results of thestring_attribute
match and falls back on only theprobabilistic
results.I have a service in Kubernetes that is getting scraped with Prometheus. I am trying to configure tail sampling to:
/metrics
,/health
, GRPC calls to export traces (where that value is in thehttp.url
attribute)The policies to keep slow and error calls work perfectly. However, I still get ~10% of the calls to
/metrics
despite having anand
policy set up to combinestring_attribute
withprobabilistic
sampling.Steps to reproduce
In Kubernetes:
otel/opentelemetry-collector-contrib
container. Relay traces to an endpoint like Jaeger or Dynatrace (I'm using Dynatrace)./metrics
show up in the trace UI, which indicates the tailsamplingprocessor was not properly dropping the matching traces.See config section below for configuration.
What did you expect to see?
I expect to see no traces from
/metrics
because thestring_attribute
policy should filter them out.What did you see instead?
I see periodic traces from
/metrics
coming through, with approximately the 10% sampling expected from theprobabilistic
policy.Here is a screenshot of one of the traces that snuck through OpenTelemetry Collector and into Dynatrace. You can see here that:
latency
policy in my config.status_code
policy.http.url
trace attribute is clearly present and there is only one trace span in the whole thing, so it wasn't a problem with too short of a tail samplingdecision_wait
or with the attribute missing.What version did you use?
Version: 0.48.0 of the
otel/opentelemetry-collector-contrib
container.What config did you use?
Environment
OS: Ubuntu 18.04.6 (the Kubernetes node OS)
Docker container:
otel/opentelemetry-collector-contrib
0.48.0Additional context
There really isn't any good mechanism for debugging the processor. I did turn the logging up to debug level to see what got logged, but all I saw was counts of trace spans that were getting through. I did see the
string_attributes
policy executing, but it didn't seem to make any difference.Here are the logs from one of the
/metrics
calls that got through. Nothing else at all was running through the system (it's a standalone POC) so I know this is the/metrics
trace. I can see it passes throughlatency.go
,status_code.go
,string_tag_filter.go
, and thenprobabilistic.go
and finally through theoltphttpexporter/oltp.go
to get to Dynatrace. I didn't expect to see it make it through thestring_tag_filter.go
to be honest.I do see the example configurations in the tailsamplingprocessor use a sort of combination of YAML and JSON; I tested it both ways in case that mattered and it doesn't.
I tried reducing the number of values to be only
\/metrics
but that didn't stop it from getting through, either. I tried switching to use thehttp.target
attribute (since that's also present) but it didn't change anything.I could be misunderstanding how the
and
policy works, so let me know if I am. Perhaps there's some other way to configure effectively the same thing, like with thecomposite
policy, but I'm not entirely sure how.The text was updated successfully, but these errors were encountered: