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

[processor/tailsamplingprocessor] documentation to drop trace #34145

Closed
mangkoran opened this issue Jul 18, 2024 · 6 comments
Closed

[processor/tailsamplingprocessor] documentation to drop trace #34145

mangkoran opened this issue Jul 18, 2024 · 6 comments
Labels
closed as inactive processor/tailsampling Tail sampling processor question Further information is requested Stale

Comments

@mangkoran
Copy link

mangkoran commented Jul 18, 2024

Component(s)

processor/tailsampling

Describe the issue you're reporting

In tailsampling readme there is no mention on how to drop a trace. What I understand from this part is that each policy will result in either "sample" or "not sample" decision. However, there is also no mention how to create a "not sample" decision.

How can I drop a certain trace? e.g. match the trace using string_attribute and drop the matched trace. Initially I thought this could be done using filter processor. However, as stated in #31355 filter processor can only drop span and not the entire trace.

@mangkoran mangkoran added the needs triage New item requiring triage label Jul 18, 2024
@github-actions github-actions bot added the processor/tailsampling Tail sampling processor label Jul 18, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jpkrohling
Copy link
Member

You can set an "invert" match: if a trace has a span with a specific attribute value for a given attribute, it would normally yield a "Sample" decision. An inverted match would yield a "Not Sample" decision.

@jpkrohling jpkrohling added question Further information is requested and removed needs triage New item requiring triage labels Jul 18, 2024
@mangkoran
Copy link
Author

mangkoran commented Jul 18, 2024

Thank you for the explanation. However I still couldn't understand the explanation in the docs:

  • When there's an "inverted not sample" decision, the trace is not sampled;
  • When there's a "sample" decision, the trace is sampled;
  • When there's a "inverted sample" decision and no "not sample" decisions, the trace is sampled;
  • In all other cases, the trace is NOT sampled

There's "inverted sample" mentioned. This is contradictory to your explanation:

An inverted match would yield a "Not Sample" decision.

From how I understand the docs, there could be 4 policy outcome:

  1. Sample, not inverted
  2. Sample, inverted
  3. Not sample, not inverted
  4. Not sample, inverted

CMIIW

@jpkrohling
Copy link
Member

I think both are right:

  • the "string" policy, for instance, would do an invert match on a specific string
  • the invert match would generate an inverted don't sample, which means "do not sample"

Here's an example from the docs:

         {
            name: test-policy-9,
            type: string_attribute,
            string_attribute: {key: http.url, values: [\/health, \/metrics], enabled_regex_matching: true, invert_match: true}
         },

In this case, if the URL contains /metrics, we are dropping the trace.

Copy link
Contributor

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Sep 17, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed as inactive processor/tailsampling Tail sampling processor question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants