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

[Feature]: Tail sampling #2044

Open
pcan opened this issue Aug 22, 2024 · 2 comments
Open

[Feature]: Tail sampling #2044

pcan opened this issue Aug 22, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request triage:todo Needs to be traiged.

Comments

@pcan
Copy link

pcan commented Aug 22, 2024

Related Problems?

No response

Describe the solution you'd like:

We are currently using the @microlabs/otel-cf-workers library to enable open telemetry our CloudFlare workers. The configuration allows to specify both head sampling and tail sampling, which gives greater flexibility to filter traces based on their content after the Spans have been generated:

const otelConfig = {
  exporter: {
    url: "http://localhost:12345/v1/traces"
  },
  sampling: {
    headSampler: { ratio: 0.01 },  // this allows to specify head sampling rule
    tailSampler: ({ localRootSpan, spans }) =>  // here we override the final decision
      localRootSpan.status.code === SpanStatusCode.ERROR ||
      localRootSpan.spanContext().traceFlags === TraceFlags.SAMPLED ||
      spans.some((s) => s.status.code === SpanStatusCode.ERROR),
  }
};

Would it be possible to achieve the same functionality with opentelemetry-rust?

Considered Alternatives

I was looking into customizing the SpanExporter, but its implementation seems to be quite locked down. In theory, based on this comment it should be possible, but I could not find any working example.

Additional Context

No response

@pcan pcan added enhancement New feature or request triage:todo Needs to be traiged. labels Aug 22, 2024
@TommyCpp TommyCpp self-assigned this Aug 27, 2024
@fw42
Copy link

fw42 commented Oct 14, 2024

@pcan: Did you find a solution? Having the same problem

@pcan
Copy link
Author

pcan commented Oct 14, 2024

@fw42 not at the moment, we deprioritized the related work for the time being, but it'd be still useful to have this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage:todo Needs to be traiged.
Projects
None yet
Development

No branches or pull requests

3 participants