Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(protocol): Add features to client sdks #3478

Merged
merged 4 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- 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
Loading