Skip to content

Commit

Permalink
fix(spans): Extracts environment from inp spans (#3269)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardgou-sentry committed Mar 15, 2024
1 parent fbb1b77 commit 2b01f4b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,14 @@ pub fn extract_tags(
{
span_tags.insert(SpanTagKey::ReplayId, replay_id.into());
}
if let Some(environment) =
span.data.value().and_then(|data| data.environment.as_str())
{
span_tags.insert(SpanTagKey::Environment, environment.into());
}
if let Some(release) = span.data.value().and_then(|data| data.release.as_str()) {
span_tags.insert(SpanTagKey::Release, release.into());
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions relay-event-schema/src/protocol/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ pub struct SpanData {
#[metastructure(field = "environment")]
pub environment: Annotated<Value>,

/// The release version of the project.
#[metastructure(field = "release")]
pub release: Annotated<Value>,

/// The decoded body size of the response (in bytes).
#[metastructure(field = "http.decoded_response_content_length")]
pub http_decoded_response_content_length: Annotated<Value>,
Expand Down Expand Up @@ -559,6 +563,7 @@ mod tests {
"mysql",
),
environment: ~,
release: ~,
http_decoded_response_content_length: ~,
http_request_method: ~,
http_response_content_length: ~,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ expression: "(&event.value().unwrap().spans, metrics)"
db_operation: ~,
db_system: ~,
environment: ~,
release: ~,
http_decoded_response_content_length: ~,
http_request_method: ~,
http_response_content_length: ~,
Expand Down Expand Up @@ -383,6 +384,7 @@ expression: "(&event.value().unwrap().spans, metrics)"
db_operation: ~,
db_system: ~,
environment: ~,
release: ~,
http_decoded_response_content_length: ~,
http_request_method: ~,
http_response_content_length: ~,
Expand Down

0 comments on commit 2b01f4b

Please sign in to comment.