Skip to content

Commit

Permalink
add server_name to transaction data (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
nrxus authored Oct 4, 2024
1 parent 16baf61 commit d0585b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions sentry-core/src/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ impl Transaction {
transaction.release.clone_from(&opts.release);
transaction.environment.clone_from(&opts.environment);
transaction.sdk = Some(std::borrow::Cow::Owned(client.sdk_info.clone()));
transaction.server_name.clone_from(&opts.server_name);

drop(inner);

Expand Down
5 changes: 5 additions & 0 deletions sentry-types/src/protocol/v7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,9 @@ pub struct Transaction<'a> {
/// Optionally HTTP request data to be sent along.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub request: Option<Request>,
/// Optionally the server (or device) name of this event.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub server_name: Option<Cow<'a, str>>,
}

impl<'a> Default for Transaction<'a> {
Expand All @@ -2008,6 +2011,7 @@ impl<'a> Default for Transaction<'a> {
spans: Default::default(),
contexts: Default::default(),
request: Default::default(),
server_name: Default::default(),
}
}
}
Expand Down Expand Up @@ -2035,6 +2039,7 @@ impl<'a> Transaction<'a> {
spans: self.spans,
contexts: self.contexts,
request: self.request,
server_name: self.server_name.map(|x| Cow::Owned(x.into_owned())),
}
}

Expand Down

0 comments on commit d0585b6

Please sign in to comment.