Skip to content

Commit

Permalink
feat(protocol): Add features to client sdks (#3478)
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 and team SDK GH issue:
getsentry/team-sdks#83.
  • Loading branch information
philipphofmann authored Apr 25, 2024
1 parent 2f3c8ff commit 52f9bb0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Separate the logic for producing UserReportV2 events (user feedback) and handle attachments in the same envelope as feedback. ([#3403](https://github.com/getsentry/relay/pull/3403))
- Use same keys for OTel span attributes and Sentry span data. ([#3457](https://github.com/getsentry/relay/pull/3457))
- Support passing owner when upserting Monitors. ([#3468](https://github.com/getsentry/relay/pull/3468))
- Add `features` to ClientSDKInfo ([#3478](https://github.com/getsentry/relay/pull/3478)
- Extract `frames.slow`, `frames.frozen`, and `frames.total` metrics from mobile spans. ([#3473](https://github.com/getsentry/relay/pull/3473))

**Internal**:
Expand Down
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
14 changes: 14 additions & 0 deletions relay-server/tests/snapshots/test_fixtures__event_schema.snap
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,20 @@ expression: "relay_event_schema::protocol::event_json_schema()"
"version"
],
"properties": {
"features": {
"description": " List of features that are enabled in the SDK. _Optional._\n\n A list of feature names identifying enabled SDK features. This list\n should contain all enabled SDK features. On some SDKs, enabling a feature in the\n options also adds an integration. We encourage tracking such features with either\n integrations or features but not both to reduce the payload size.",
"default": null,
"type": [
"array",
"null"
],
"items": {
"type": [
"string",
"null"
]
}
},
"integrations": {
"description": " List of integrations that are enabled in the SDK. _Optional._\n\n The list should have all enabled integrations, including default integrations. Default\n integrations are included because different SDK releases may contain different default\n integrations.",
"default": null,
Expand Down

0 comments on commit 52f9bb0

Please sign in to comment.