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/probabilisticsampler] Added Spans Count Metric #36151

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akstron
Copy link

@akstron akstron commented Nov 2, 2024

Description

Generated spans count metric using the metadata.yaml and incremented the counter with each span processing.

Link to tracking issue

Fixes: #34272

Signed-off-by: Alok Kumar Singh <[email protected]>
@akstron akstron requested review from jpkrohling, jmacd and a team as code owners November 2, 2024 17:59
@github-actions github-actions bot added the processor/probabilisticsampler Probabilistic Sampler processor label Nov 2, 2024
@@ -174,6 +174,7 @@ func (tp *traceProcessor) processTraces(ctx context.Context, td ptrace.Traces) (
td.ResourceSpans().RemoveIf(func(rs ptrace.ResourceSpans) bool {
rs.ScopeSpans().RemoveIf(func(ils ptrace.ScopeSpans) bool {
ils.Spans().RemoveIf(func(s ptrace.Span) bool {
tp.telemetryBuilder.ProcessorProbabilisticSamplerCountSpansSampled.Add(ctx, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I get this - did you mean to record a count of all spans going through the processor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. As I understand the issue linked this is what was requested.

Signed-off-by: Alok Kumar Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/probabilisticsampler Probabilistic Sampler processor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Probabilistic sampler: emit metrics for number of spans sampled
3 participants