-
Notifications
You must be signed in to change notification settings - Fork 115
feat(transaction): Propagate segment_name to spans #5959
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
Changes from 2 commits
81e0535
1849fed
6ccfd87
fc73a74
a48d977
76e5d1b
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 |
|---|---|---|
|
|
@@ -59,6 +59,30 @@ impl std::fmt::Display for RenderBlockingStatus { | |
| } | ||
| } | ||
|
|
||
| /// Extracts the `transaction` field and writes it into child spans | ||
| /// as `data.segment_name`. | ||
| pub fn extract_segment_name(event: &mut Event) { | ||
| let Some(transaction) = event.transaction.value() else { | ||
| return; | ||
| }; | ||
|
|
||
| let Some(spans) = event.spans.value_mut() else { | ||
| return; | ||
| }; | ||
|
|
||
| for span in spans { | ||
| let Some(span) = span.value_mut() else { | ||
| continue; | ||
| }; | ||
|
|
||
| let data = span.data.get_or_insert_with(Default::default); | ||
|
|
||
| if data.segment_name.is_empty() { | ||
| data.segment_name = Annotated::new(transaction.clone()); | ||
| } | ||
|
Comment on lines
+80
to
+82
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. Bug: The check Suggested FixTo correctly check for a missing value in an Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
| } | ||
| } | ||
|
|
||
| /// Wrapper for [`extract_span_tags`]. | ||
| /// | ||
| /// Tags longer than `max_tag_value_size` bytes will be truncated. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.