Skip to content

Commit

Permalink
feat(profiles): Add an optional client SDK field for Sample V2 format (
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops authored Aug 2, 2024
1 parent 871ba75 commit 09f0897
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

- Add experimental support for V2 envelope buffering. ([#3855](https://github.com/getsentry/relay/pull/3855), [#3863](https://github.com/getsentry/relay/pull/3863))
- Add `client_sample_rate` to spans, pulled from the trace context. ([#3872](https://github.com/getsentry/relay/pull/3872))
- Collect SDK information in profile chunks. ([#3882](https://github.com/getsentry/relay/pull/3882))
- Introduce `trim = "disabled"` type attribute to prevent trimming of spans. ([#3877](https://github.com/getsentry/relay/pull/3877))

## 24.7.1

Expand Down
9 changes: 9 additions & 0 deletions relay-profiling/src/sample/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,19 @@ pub struct ProfileMetadata {
pub platform: String,
pub release: String,

#[serde(skip_serializing_if = "Option::is_none")]
pub client_sdk: Option<ClientSdk>,

/// Hard-coded string containing "2" to indicate the format version.
pub version: Version,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct ClientSdk {
name: String,
version: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Sample {
/// Unix timestamp in seconds with millisecond precision when the sample
Expand Down
4 changes: 4 additions & 0 deletions relay-profiling/tests/fixtures/sample/v2/valid.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"timestamp": 1710805688.237,
"release": "0.1 (199)",
"platform": "cocoa",
"client_sdk": {
"name": "sentry-cocoa",
"version": "7.6.1"
},
"profile": {
"samples": [
{
Expand Down

0 comments on commit 09f0897

Please sign in to comment.