You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/sdk/expected-features/index.mdx
+8-17Lines changed: 8 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ What scope means depends on the application, for a web framework it is most like
30
30
31
31
## Automatic Context Data
32
32
33
-
Automatic addition of useful attributes such as `tags` or `extra` or specific `contexts`. Typically means the SDK hooks into a framework so that it can set attributes that are known to be useful for most users. Please check [Data Handling](/sdk/expected-features/data-handling) for considerations.
33
+
Automatic addition of useful attributes such as `flags` or `tags` or `extra` or specific `contexts`. Typically means the SDK hooks into a framework so that it can set attributes that are known to be useful for most users. Please check [Data Handling](/sdk/expected-features/data-handling) for considerations.
34
34
35
35
## Breadcrumbs
36
36
@@ -118,24 +118,15 @@ This functionality should be gated behind the `includeLocalVariables` option, wh
118
118
119
119
## Feature Flags
120
120
121
-
An SDK may expose a Scope property for tracking feature flag evaluations. When the scope forks, it's important to clone the feature flags property. Leaking flag evaluations between threads could lead to inaccurate feature flag evaluation logs.
121
+
An SDK may optionally support feature flag collection. Feature flags are collected on evaluation, stored on the scope, and submitted to Sentry on error obeying the schema specified in the <Linkto="/sdk/data-model/event-payloads/contexts/#feature-flag-context">Feature Flag Context</Link> protocol documentation.
122
122
123
-
The Scope's flag property should have a capped capacity and should prefer recently-evaluated flags over less-recently-evaluated flags. The recommended data structure is a LRU-cache but it is not required so long as the data structure behaves similarly. Serious deviations from the behavior of an LRU-cache should be documented for your language.
123
+
If an SDK supports feature flags it must expose a function `set_flag` which has identical behavior to the `set_tag` function. It must accept a key of type string and a value which is a union of string, boolean, integer, float, and structure. An SDK may hold up to 100 evaluations. Evaluations are ordered based on their evaluation time. Typically, an LRUcache is used to store feature flags. When the capacity of the cache is exceeded the oldest flag is dropped. Any (or multiple) data structure(s) may be chosen by the SDK to store feature flags as long as the evaluation order of the flags is maintained.
124
124
125
-
The Scope's flag property should expose two methods: `get/0` and `set/2`. `set/2` takes two arguments. The first argument is the name of the flag. It is of type string. The second argument is the evaluation result. It is of type boolean. `set/2` should remove all entries from the LRU-cache which match the provided flag's name and append the new evaluation result to the end of the queue. `get/0` accepts zero arguments. The `get/0` method must return a list of serialized flag evaluation results in order of evaluation. Oldest values first, newest values last. See the <Linkto="/sdk/data-model/event-payloads/contexts/#feature-flag-context">Feature Flag Context</Link> protocol documentation for details.
125
+
Because flags are stored on the scope, when a scope forks the flags data structure must be cloned. Failure to clone the data structure appropriately will lead to flags leaking across thread boundaries and lead to unexpected results.
126
126
127
127
### Integrations
128
128
129
-
Integrations automate the work of tracking feature flag evaluations and serializing them on error context. An integration should hook into third-party SDK and record feature flag evaluations using the current scope. For example, in Python an integration would call `sentry_sdk.get_current_scope().flags.set(...)` on each flag evaluation.
130
-
131
-
An integration is also responsible for registering an "on error" hook with the Sentry SDK. When an error occurs the integration should request the current scope and serialize the flags property. For example, in Python an integration might define this callback function:
Integrations automate the work of tracking feature flag evaluations. An integration should hook into a third-party SDK and record feature flag evaluations using the current scope.
139
130
140
131
## Desymbolication
141
132
@@ -346,7 +337,7 @@ The SDK automatically captures HTTP Client errors and sends them to [sentry.io](
346
337
347
338
The HTTP Client integration should have 3 configuration options:
348
339
349
-
-`captureFailedRequests` defaults to `false` due to PII reasons.
340
+
-`captureFailedRequests` defaults to `false`when introducing this feature due to PII reasons and can be changed to `true` in a follow up major.
350
341
- The SDK will only capture HTTP Client errors if it is enabled.
351
342
-`failedRequestStatusCodes` defaults to `500 - 599`, this configuration option accepts a `List` of `HttpStatusCodeRange` which is a range of HTTP status code -> `min` to `max` or a single `status_code`.
352
343
- The SDK will only capture HTTP Client errors if the HTTP Response status code is within the defined ranges in `failedRequestStatusCodes`.
@@ -547,9 +538,9 @@ Ability for the SDK to attach request body to events and triggered during the ex
547
538
User should be able to set a configuration option `maxRequestBodySize` to instruct SDK how big requests bodies should be attached.
548
539
SDK controls what is an actual size in bytes for each option:
Copy file name to clipboardExpand all lines: develop-docs/sdk/miscellaneous/hub_and_scope_refactoring.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ This scope is probably only used for process-wide data like the `release`.
78
78
79
79
**Isolation Scope**
80
80
81
-
This scope holds data only applicable to the current request (on a server), tab (in a browser), or user (on a mobile). The top-level APIs that manipulate data (like `sentry_sdk.set_tag()`, `sentry_sdk.set_context()` etc) write to the isolation scope (at least once the migration phase is over, see "Backwards Compatibility").
81
+
This scope holds data only applicable to the current request (on a server), tab (in a browser), or user (on a mobile). The top-level APIs that manipulate data (like `sentry_sdk.set_flag()`, `sentry_sdk.set_tag()`, `sentry_sdk.set_context()` etc.) write to the isolation scope (at least once the migration phase is over, see "Backwards Compatibility").
82
82
83
83
The isolation scope is stored in a context variable, thread local, async local, or something similar (depending on the platform). It may also be stored on OTel `Context` so we can rely on OTels `Context` propagation once SDKs implement POTEL.
-`scope.set_extras(extras)`: Sets an object with key/value pairs, convenience function instead of multiple `set_extra` calls. As with `set_extra` this is considered deprecated functionality.
218
218
219
+
-`scope.set_flag(key, value)`: Sets the flag to a string value, overwriting a potential previous value. Entries can not be removed except by expiration.
220
+
219
221
-`scope.set_tag(key, value)`: Sets the tag to a string value, overwriting a potential previous value. Removing a key is SDK-defined, either with a `remove_tag` function or by passing nothing as data.
220
222
221
223
-`scope.set_tags(tags)`: Sets an object with key/value pairs, convenience function instead of multiple `set_tag` calls.
Copy file name to clipboardExpand all lines: develop-docs/sdk/processes/basics.mdx
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,13 +32,17 @@ When sending events just substitute `orgXXX.ingest.sentry.io` with `localhost:30
32
32
whichever port you ended up chosing. Also note that a local relay will out of the box
33
33
be available via HTTP only so don't try to send HTTPS requests there.
34
34
35
-
## Join us on Discord
36
-
37
-
You can reach out to Sentry open source contributors and talk with other SDK maintainers on the [Sentry Discord server](https://discord.gg/sentry).
38
-
39
35
## Consult Existing SDKs
40
36
41
37
While we're trying to keep the docs up to date about all important things, it's usually
42
38
a good idea to refer to already existing Sentry SDKs for input. In particular the
43
39
transport design is not part of the documentation but generally quite similar between
44
40
SDKs.
41
+
42
+
## Type out context in Relay
43
+
44
+
To have a better understanding of various [context](https://develop.sentry.dev/sdk/data-model/event-payloads/contexts/) our SDKs emit, any newly added context should also be typed out in [Relay](https://github.com/getsentry/relay/tree/master/relay-event-schema/src/protocol/contexts).
45
+
46
+
## Join us on Discord
47
+
48
+
You can reach out to Sentry open source contributors and talk with other SDK maintainers on the [Sentry Discord server](https://discord.gg/sentry).
0 commit comments