Skip to content

Commit

Permalink
feat(profiles): Add a client SDK field to Sample V2 format
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops committed Jul 31, 2024
1 parent 72b5d37 commit 3a36b60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions relay-profiling/src/sample/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ pub struct ProfileMetadata {
pub platform: String,
pub release: String,

pub client_sdk: 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 3a36b60

Please sign in to comment.