Skip to content

Commit 2d8b1f3

Browse files
authored
Merge branch 'master' into codyde/javascript-tracing-refactor
2 parents 00993d8 + 00874c4 commit 2d8b1f3

File tree

204 files changed

+5076
-2602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+5076
-2602
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@
4545

4646
# ###### Replays #######
4747

48-
# /src/docs/product/session-replay/ @getsentry/replay
49-
# /src/includes/session-replay-web-report-bug.mdx @getsentry/replay
50-
# /src/platform-includes/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
51-
# /src/platforms/javascript/common/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
52-
# /src/wizard/javascript/replay-onboarding/ @getsentry/replay @getsentry/replay-sdk-web
48+
# /src/docs/product/session-replay/web @jas-kas @getsentry/replay-sdk-web @getsentry/replay-frontend @getsentry/replay-backend
49+
# /src/docs/product/session-replay/mobile @jas-kas @getsentry/replay-sdk-mobile @getsentry/replay-frontend @getsentry/replay-backend
50+
# /src/includes/session-replay-web-report-bug.mdx @getsentry/replay-sdk-web
51+
# /src/platform-includes/session-replay/ @getsentry/replay-sdk-web @getsentry/replay-sdk-mobile
52+
# /src/platforms/javascript/common/session-replay/ @getsentry/replay-sdk-web
5353

54-
# /src/docs/product/dev-toolbar/ @getsentry/replay
54+
# /src/docs/product/dev-toolbar/ @ryan953 @jas-kas
5555

5656
# ###### End Replays #######

.github/workflows/bump-api-schema-sha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/[email protected]
1515
- name: Get auth token
1616
id: token
17-
uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
17+
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
1818
with:
1919
app-id: ${{ vars.SENTRY_INTERNAL_APP_ID }}
2020
private-key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- name: Get auth token
1717
id: token
18-
uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
18+
uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
1919
with:
2020
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
2121
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

develop-docs/development-infrastructure/devservices.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ commands:
2525
purge Purge the local devservices cache
2626
```
2727
28+
## Installation
29+
30+
Installation instructions can be found [here](https://github.com/getsentry/devservices?tab=readme-ov-file#installation).
31+
2832
## Viewing logs for a service
2933
3034
```shell

develop-docs/sdk/data-model/envelope-items.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ details.
146146

147147
*None*
148148

149-
### Statsd
149+
### Statsd (deprecated)
150150

151151
Item type `"statsd"` contains metrics emissions in a superset of the statsd format.
152152

@@ -162,7 +162,7 @@ details.
162162

163163
*None*
164164

165-
### Metric Meta
165+
### Metric Meta (deprecated)
166166

167167
Item type `"metric_meta"` contains per-metric meta data which is persisted alongside
168168
metrics in the system.

develop-docs/sdk/expected-features/data-handling.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ Fields in the event payload that allow user-specified or dynamic values are rest
111111

112112
- Mappings of values (such as HTTP data, extra data, etc) are limited to 50 item pairs.
113113
- Event IDs are limited to 36 characters and must be valid UUIDs.
114+
- Flag keys are limited to 32 characters.
115+
- Flag values are limited to 200 characters.
114116
- Tag keys are limited to 32 characters.
115117
- Tag values are limited to 200 characters.
116118
- Culprits are limited to 200 characters.

develop-docs/sdk/expected-features/index.mdx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ What scope means depends on the application, for a web framework it is most like
3030

3131
## Automatic Context Data
3232

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.
3434

3535
## Breadcrumbs
3636

@@ -118,24 +118,15 @@ This functionality should be gated behind the `includeLocalVariables` option, wh
118118

119119
## Feature Flags
120120

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 <Link to="/sdk/data-model/event-payloads/contexts/#feature-flag-context">Feature Flag Context</Link> protocol documentation.
122122

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 LRU cache 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.
124124

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 <Link to="/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.
126126

127127
### Integrations
128128

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:
132-
133-
```python
134-
def flag_error_processor(event, exc_info):
135-
scope = sentry_sdk.get_current_scope()
136-
event["contexts"]["flags"] = {"values": scope.flags.get()}
137-
return event
138-
```
129+
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.
139130

140131
## Desymbolication
141132

@@ -346,7 +337,7 @@ The SDK automatically captures HTTP Client errors and sends them to [sentry.io](
346337

347338
The HTTP Client integration should have 3 configuration options:
348339

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.
350341
- The SDK will only capture HTTP Client errors if it is enabled.
351342
- `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`.
352343
- 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
547538
User should be able to set a configuration option `maxRequestBodySize` to instruct SDK how big requests bodies should be attached.
548539
SDK controls what is an actual size in bytes for each option:
549540

550-
- `none` (default)
541+
- `none`
551542
- `small` - `1000` bytes
552-
- `medium` - `10000` bytes
543+
- `medium` - `10000` bytes (default)
553544
- `always`
554545

555546
## Log context

develop-docs/sdk/miscellaneous/hub_and_scope_refactoring.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ This scope is probably only used for process-wide data like the `release`.
7878

7979
**Isolation Scope**
8080

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").
8282

8383
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.
8484

develop-docs/sdk/miscellaneous/unified-api/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ Sentry.configureScope((scope) =>
216216

217217
- `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.
218218

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+
219221
- `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.
220222

221223
- `scope.set_tags(tags)`: Sets an object with key/value pairs, convenience function instead of multiple `set_tag` calls.

develop-docs/sdk/processes/basics.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ When sending events just substitute `orgXXX.ingest.sentry.io` with `localhost:30
3232
whichever port you ended up chosing. Also note that a local relay will out of the box
3333
be available via HTTP only so don't try to send HTTPS requests there.
3434

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-
3935
## Consult Existing SDKs
4036

4137
While we're trying to keep the docs up to date about all important things, it's usually
4238
a good idea to refer to already existing Sentry SDKs for input. In particular the
4339
transport design is not part of the documentation but generally quite similar between
4440
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

Comments
 (0)