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

Probabilistic sampler: emit metrics for number of spans sampled #34272

Open
shinkle-procore opened this issue Jul 26, 2024 · 7 comments · May be fixed by #36151
Open

Probabilistic sampler: emit metrics for number of spans sampled #34272

shinkle-procore opened this issue Jul 26, 2024 · 7 comments · May be fixed by #36151
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers processor/probabilisticsampler Probabilistic Sampler processor

Comments

@shinkle-procore
Copy link

Component(s)

processor/probabilisticsampler

Is your feature request related to a problem? Please describe.

We are trying to build SLOs (Service Level Objectives) around our telemetry pipeline. One of the indicators we use is the ratio of "spans received by receiver" to "spans sent by the exporter" expecting that ratio to stay close to 1 (otherwise it means we're dropping spans during processing).

Now that we have probabilistic sampling set up (at 10%), we're finding that ratio is around 0.1 instead of 1, which makes sense. However, just adding a factor of 10 to our SLO measurement to compensate is hacky. We would like to factor something like "otelcol_processor_probabilistic_sampler_count_spans_sampled" into our calculation, but right now we only have access to "otelcol_processor_probabilistic_sampler_count_traces_sampled"

The telemetry in the core collector library seems to revolve around "spans" while the sampler metrics revolve around "traces", so it's difficult to compare the two in calculations.

Describe the solution you'd like

Emit a metric of "otelcol_processor_probabilistic_sampler_count_spans_sampled" from the probabilistic sampler processor.

Describe alternatives you've considered

No response

Additional context

No response

@shinkle-procore shinkle-procore added enhancement New feature or request needs triage New item requiring triage labels Jul 26, 2024
Copy link
Contributor

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 processor/probabilisticsampler Probabilistic Sampler processor label Jul 26, 2024
@jpkrohling jpkrohling removed the needs triage New item requiring triage label Aug 13, 2024
@jpkrohling jpkrohling self-assigned this Aug 13, 2024
@jpkrohling
Copy link
Member

@shinkle-procore, would you like to add it yourself? It should be relatively easy to add this.

@shinkle-procore
Copy link
Author

@jpkrohling If I had more bandwidth and experience with the stack, yes :) unfortunately it's not something I can work on now.

@jpkrohling jpkrohling added the good first issue Good for newcomers label Aug 15, 2024
@mahadzaryab1
Copy link

@jpkrohling I'm interested in working on this! Would you be able to guide me on what needs to be done?

@mahadzaryab1
Copy link

@jpkrohling
Copy link
Member

Close: I think this would be the right place: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/probabilisticsamplerprocessor/sampler_mode.go#L522

Instead of adding "1" to the new metric, it would add the count of items in the item T.

@amritanshu-pandey
Copy link

Any progress on this @mahadzaryab1? Otherwise I am also keen to contribute to this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers processor/probabilisticsampler Probabilistic Sampler processor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants