-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add span skip attribute for span metrics generation #1626
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1626 +/- ##
==========================================
- Coverage 71.18% 71.18% -0.01%
==========================================
Files 197 197
Lines 19881 19911 +30
==========================================
+ Hits 14153 14174 +21
- Misses 5044 5059 +15
+ Partials 684 678 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a small comment.
pkg/export/alloy/traces.go
Outdated
if tr.spanMetricsEnabled { | ||
traceAttrs[attr.SkipSpanMetrics] = struct{}{} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks duplicate (already inside getConstantAttributes
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice catch, I moved it there so I can make the test and forgot to take out out.
Beyla can directly generate span metrics for quick access to unified metrics and service graphs without the need for trace generation. This mainly done to ensure we can generate accurate metrics even in case of trace sampling with head sampling. Tail sampling doesn't need this option, however it does usually require higher compute cost.
In case we generate span metrics directly from Beyla and we also generate traces, some data will be duplicated if the collector has also enabled the span metrics processor. To help with filtering double counted metrics, this PR introduces a new attribute which will get attached to the spans, signalling that the span metrics are already generated and they can be ignored by the span metrics processor. The span metrics processor can check for this flag and drop the trace sample from metrics.
The new attribute is
span.metrics.skip = true
.