Skip to content

Commit

Permalink
feat(protocol): Add features to client sdks
Browse files Browse the repository at this point in the history
This PR adds features to the ClientSDKInfo. Related develop docs PR:
getsentry/develop#1244.
  • Loading branch information
philipphofmann committed Apr 24, 2024
1 parent 160946f commit dcab271
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions relay-event-schema/src/protocol/clientsdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ pub struct ClientSdkInfo {
#[metastructure(skip_serialization = "empty_deep")]
pub integrations: Annotated<Array<String>>,

/// List of features that are enabled in the SDK. _Optional._
///
/// A list of feature names identifying enabled SDK features. This list
/// should contain all enabled SDK features. On some SDKs, enabling a feature in the
/// options also adds an integration. We encourage tracking such features with either
/// integrations or features but not both to reduce the payload size.
#[metastructure(skip_serialization = "empty_deep")]
pub features: Annotated<Array<String>>,

/// List of installed and loaded SDK packages. _Optional._
///
/// A list of packages that were installed as part of this SDK or the activated integrations.
Expand Down Expand Up @@ -96,6 +105,9 @@ mod tests {
"integrations": [
"actix"
],
"features": [
"feature1"
],
"packages": [
{
"name": "cargo:sentry",
Expand All @@ -113,6 +125,7 @@ mod tests {
name: Annotated::new("sentry.rust".to_string()),
version: Annotated::new("1.0.0".to_string()),
integrations: Annotated::new(vec![Annotated::new("actix".to_string())]),
features: Annotated::new(vec![Annotated::new("feature1".to_string())]),
packages: Annotated::new(vec![
Annotated::new(ClientSdkPackage {
name: Annotated::new("cargo:sentry".to_string()),
Expand Down Expand Up @@ -149,6 +162,7 @@ mod tests {
name: Annotated::new("sentry.rust".to_string()),
version: Annotated::new("1.0.0".to_string()),
integrations: Annotated::empty(),
features: Annotated::empty(),
packages: Annotated::empty(),
client_ip: Annotated::new(IpAddr("127.0.0.1".to_owned())),
other: Default::default(),
Expand Down

0 comments on commit dcab271

Please sign in to comment.