-
Notifications
You must be signed in to change notification settings - Fork 93
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
chore(eap-spans): Add a field to suggest consumers to ingest spans in EAP #4206
Merged
phacops
merged 10 commits into
master
from
pierre/eap-spans-add-ingest-in-eap-field-to-spans
Nov 4, 2024
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bd5f195
chore(eap-spans): Add a field to suggest consumers to ingest spans in…
phacops f30db81
Add a CHANGELOG entry
phacops 6336210
Update snapshots
phacops 9c1be61
Fix tests
phacops 1d6979a
Update relay-server snapshots
phacops 24a1245
Update relay-spans snapshots
phacops dd8c267
Use item headers instead
phacops 63c2983
Update snapshots
phacops edbdd20
Use item and not span
phacops 76c3e02
Make the field a Kafka header
phacops File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...napshots/relay_server__metrics_extraction__event__tests__extract_span_metrics_mobile.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,13 @@ pub fn process( | |
}; | ||
new_item.set_payload(ContentType::Json, payload); | ||
new_item.set_metrics_extracted(item.metrics_extracted()); | ||
new_item.set_ingest_span_in_eap( | ||
state | ||
.project_info | ||
.config | ||
.features | ||
.has(Feature::IngestSpansInEap), | ||
); | ||
|
||
*item = new_item; | ||
|
||
|
@@ -279,6 +286,11 @@ pub fn extract_from_event( | |
.envelope() | ||
.dsc() | ||
.and_then(|ctx| ctx.sample_rate); | ||
let ingest_in_eap = state | ||
.project_info | ||
.config | ||
.features | ||
.has(Feature::IngestSpansInEap); | ||
|
||
let mut add_span = |mut span: Span| { | ||
add_sample_rate( | ||
|
@@ -330,6 +342,7 @@ pub fn extract_from_event( | |
item.set_payload(ContentType::Json, span); | ||
// If metrics extraction happened for the event, it also happened for its spans: | ||
item.set_metrics_extracted(state.event_metrics_extracted); | ||
item.set_ingest_span_in_eap(ingest_in_eap); | ||
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. We could make the header an envelope header and set it in a more central place (e.g. |
||
|
||
relay_log::trace!("Adding span to envelope"); | ||
state.managed_envelope.envelope_mut().add_item(item); | ||
|
@@ -360,6 +373,7 @@ pub fn extract_from_event( | |
) else { | ||
return; | ||
}; | ||
|
||
// Add child spans as envelope items. | ||
if let Some(child_spans) = event.spans.value() { | ||
for span in child_spans { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Interesting, where did this come from?