-
Notifications
You must be signed in to change notification settings - Fork 104
feat(spans): Accept V2 spans and convert them to V1 spans #4771
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
Conversation
After discussion with @Dav1dde it's clear that the conversion/expansion needs to be moved—it needs to happen before inbound filters are applied at the start of |
edeb437
to
b7bb4ae
Compare
assert [m for m in metrics if ":spans/" in m["name"]] == expected_span_metrics | ||
|
||
span_metrics = [m for m in metrics if ":spans/" in m["name"]] | ||
|
||
assert len(span_metrics) == len(expected_span_metrics) | ||
for actual, expected in zip(span_metrics, expected_span_metrics): | ||
assert actual == expected |
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.
Any objection to me rewriting the assertion this way? Checking the whole list diff at once will drive you insane.
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.
In this file, the envelope_with_spans
function now adds two V2 envelopes as well. Consequently, a bunch of consumed spans and metrics change slightly.
@@ -51,13 +51,11 @@ use crate::constants::DEFAULT_EVENT_RETENTION; | |||
use crate::extractors::{PartialMeta, RequestMeta}; | |||
|
|||
mod attachment; | |||
#[cfg(feature = "processing")] |
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.
We need access to ItemContainer
for span V2 parsing even outside of processing, so this feature gate needs to go.
This says #skip-changelog but it occurs to me that this is the first Span V2 related change that might actually deserve an entry, wdyt? |
Good idea, as this is effectively the first commit which accepts span v2 envelopes. But maybe call out that this is still highly experimental. |
I'll remove all of the outcome/category logic changes for now, they only confuse the issue. |
5d9d461
to
d52b219
Compare
This implements the conversion of Span V2 items/item containers in envelopes to Span V1. At the start of
span::processing::process
, if there is a Span V2 container item, it is removed and replaced with individual items for the converted spans. Theprocess
function now returns aResult
because it rejects envelopes containing more than one Span V2 container (in line with the design; this may be lifted in future).ref: RELAY-64