-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(spans): Use is_segment as alternative of is_remote
#102296
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
base: master
Are you sure you want to change the base?
Changes from all commits
ea43e87
7e0f537
9ce2d02
a874d8a
3c78e74
1071349
4fdc4b6
2677c44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ def _find_segment_span(spans: list[SpanEvent]) -> SpanEvent | None: | |
|
|
||
| # Iterate backwards since we usually expect the segment span to be at the end. | ||
| for span in reversed(spans): | ||
| if attribute_value(span, "sentry.is_segment"): | ||
| if span.get("is_segment"): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return span | ||
|
|
||
| return None | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,6 @@ def make_compatible(span: SpanEvent) -> CompatibleSpan: | |
| "sentry_tags": _sentry_tags(span.get("attributes") or {}), | ||
| "op": get_span_op(span), | ||
| "exclusive_time": attribute_value(span, "sentry.exclusive_time_ms"), | ||
| "is_segment": bool(attribute_value(span, "sentry.is_segment")), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field is now set by |
||
| } | ||
|
|
||
| return ret | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,6 @@ class CompatibleSpan(SpanEvent, total=True): | |
| exclusive_time: float | ||
| op: str | ||
| sentry_tags: dict[str, str] | ||
| is_segment: bool | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now part of the official schema. |
||
|
|
||
| # Added by `SpanGroupingResults.write_to_spans` in `_enrich_spans` | ||
| hash: NotRequired[str] | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
is the renaming from
sentry.is_segmenttois_segmentintentional? what do we do for old vs new queries?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.
This is now a toplevel field instead of being stored in
attributesassentry.is_segment.From my understanding on the query side nothing should change as at the end of the pipeline the top level field is materialized into EAP still as
sentry.is_segment. See change inprocess/convert.py.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.
My idea was that we use
is_segmentin the buffer code, and thenconvert_span_to_itemwrites the attribute tosentry.is_segmentsuch that all product queries still work as expected.I realize now that we might get wrong behavior if the buffer still contains spans with the old format, but the segment consumer already expects the new format. Should I update the span consumer and the segment consumer in separate PRs, and let the span consumer double-write initially?
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 to be sure that in-flight data in redis does not cause crashes in old vs new versions of the spans consumer too. i think that if you update only the part that inserts into redis first, and then secondarily the flusher process and segments consumer, we should be good.
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.
I think we're good then -- the changes I'm making all happen after redis, except for the additional check of
is_remote, which does not change the evaluation of the conditionsegment_span_id == span["span_id"]here.