|
2 | 2 |
|
3 | 3 | ## Unreleased |
4 | 4 |
|
| 5 | +### Features |
| 6 | + |
| 7 | +- Add `LocalSentrySpan` to `sentry-compose` so apps can provide a parent `ISpan` to a composable subtree and have nested `SentryTraced` spans attach to it ([#6112]https://github.com/getsentry/sentry-java/pull/6112) |
| 8 | +- Add `dataCollection`, a fine-grained replacement for `sendDefaultPii`, for controlling data collected automatically by SDK integrations ([#5759](https://github.com/getsentry/sentry-java/pull/5759)) |
| 9 | + - `sendDefaultPii` remains supported for backwards compatibility. When `dataCollection` is not configured, the SDK preserves the existing `sendDefaultPii` behavior. |
| 10 | + - Configuring any `dataCollection` option makes it the source of truth. `sendDefaultPii` is then ignored, and omitted `dataCollection` options use the defaults below. |
| 11 | + - The Logback appender is a compatibility exception. When an encoder is configured, `sendDefaultPii=true` continues to include the original message template and parameters. To opt in independently of `sendDefaultPii`, set `<includeUnencodedMessage>true</includeUnencodedMessage>` on the Sentry appender in `logback.xml` or `logback-spring.xml`. |
| 12 | + - Data explicitly supplied through APIs such as `Sentry.setUser`, scopes, event processors, or `beforeSend` is not affected. |
| 13 | + |
| 14 | + To opt in to the documented `dataCollection` defaults without configuring an individual option: |
| 15 | + |
| 16 | + ```java |
| 17 | + Sentry.init(options -> options.getDataCollection().forceDataCollection()); |
| 18 | + ``` |
| 19 | + |
| 20 | + | Option | Default | Behavior | |
| 21 | + | --- | --- | --- | |
| 22 | + | `userInfo` | `true` | Allows integrations to populate user identity and IP address information automatically. | |
| 23 | + | `cookies` | `{ mode: DENY_LIST, terms: [] }` | Collects cookies while filtering sensitive values. | |
| 24 | + | `httpHeaders.request` | `{ mode: DENY_LIST, terms: [] }` | Collects request headers while filtering sensitive values. | |
| 25 | + | `httpHeaders.response` | `{ mode: DENY_LIST, terms: [] }` | Collects response headers while filtering sensitive values. | |
| 26 | + | `httpBodies` | All supported body types | Collects supported incoming and outgoing request and response bodies. An empty set disables body collection. | |
| 27 | + | `urlQueryParams` | `{ mode: DENY_LIST, terms: [] }` | Collects URL query parameters while filtering sensitive values. | |
| 28 | + | `graphql.document` | `true` | Collects GraphQL documents. | |
| 29 | + | `graphql.variables` | `true` | Collects GraphQL variables. | |
| 30 | + | `databaseQueryData` | `true` | Allows collection of associated query data, such as bound parameters, write payloads, and results, where supported. Sanitized query statements and structural database metadata remain available. | |
| 31 | + | `filePaths` | `true` | Allows file-system instrumentation to collect file and directory paths. File extensions and byte counts remain available when disabled. | |
| 32 | + |
| 33 | + Cookies, HTTP headers, and URL query parameters support three modes: |
| 34 | + |
| 35 | + - `OFF`: Do not collect the category. |
| 36 | + - `DENY_LIST`: Collect values except those matching the built-in sensitive deny-list or additional configured terms. |
| 37 | + - `ALLOW_LIST`: Only send plaintext values for matching terms. The built-in sensitive deny-list still applies. |
| 38 | + |
| 39 | + Matching is case-insensitive and partial. The built-in sensitive deny-list contains `auth`, `token`, `secret`, `password`, `passwd`, `pwd`, `key`, `jwt`, `bearer`, `sso`, `saml`, `csrf`, `xsrf`, `credentials`, `session`, `sid`, and `identity`. Filtered values are replaced with `"[Filtered]"`. Custom deny-list terms extend rather than replace this list. |
| 40 | + |
| 41 | + Configure all HTTP body types, a custom cookie deny-list, a request-header allow-list, and disable URL query parameter and file path collection in an options callback: |
| 42 | + |
| 43 | + ```java |
| 44 | + Sentry.init( |
| 45 | + options -> { |
| 46 | + options |
| 47 | + .getDataCollection() |
| 48 | + .setHttpBodies( |
| 49 | + EnumSet.of( |
| 50 | + HttpBodyType.INCOMING_REQUEST, |
| 51 | + HttpBodyType.OUTGOING_REQUEST, |
| 52 | + HttpBodyType.INCOMING_RESPONSE, |
| 53 | + HttpBodyType.OUTGOING_RESPONSE)); |
| 54 | + options |
| 55 | + .getDataCollection() |
| 56 | + .setCookies( |
| 57 | + KeyValueCollectionBehavior.denyList( |
| 58 | + "forwarded", "-ip", "remote-", "via", "-user")); |
| 59 | + options |
| 60 | + .getDataCollection() |
| 61 | + .getHttpHeaders() |
| 62 | + .setRequest( |
| 63 | + KeyValueCollectionBehavior.allowList("content-type", "x-request-id")); |
| 64 | + options |
| 65 | + .getDataCollection() |
| 66 | + .setUrlQueryParams(KeyValueCollectionBehavior.off()); |
| 67 | + options.getDataCollection().setFilePaths(false); |
| 68 | + }); |
| 69 | + ``` |
| 70 | + |
| 71 | + Configure the same options in `sentry.properties`: |
| 72 | + |
| 73 | + ```properties |
| 74 | + data-collection.http-bodies=incoming_request,outgoing_request,incoming_response,outgoing_response |
| 75 | + data-collection.cookies.mode=deny_list |
| 76 | + data-collection.cookies.terms=forwarded,-ip,remote-,via,-user |
| 77 | + data-collection.http-headers.request.mode=allow_list |
| 78 | + data-collection.http-headers.request.terms=content-type,x-request-id |
| 79 | + data-collection.url-query-params.mode=off |
| 80 | + data-collection.file-paths=false |
| 81 | + ``` |
| 82 | + |
| 83 | + Configure them with Spring Boot properties: |
| 84 | + |
| 85 | + ```properties |
| 86 | + sentry.data-collection.http-bodies=incoming-request,outgoing-request,incoming-response,outgoing-response |
| 87 | + sentry.data-collection.cookies.mode=deny-list |
| 88 | + sentry.data-collection.cookies.terms=forwarded,-ip,remote-,via,-user |
| 89 | + sentry.data-collection.http-headers.request.mode=allow-list |
| 90 | + sentry.data-collection.http-headers.request.terms=content-type,x-request-id |
| 91 | + sentry.data-collection.url-query-params.mode=off |
| 92 | + sentry.data-collection.file-paths=false |
| 93 | + ``` |
| 94 | + |
| 95 | + Configure them in `AndroidManifest.xml`: |
| 96 | + |
| 97 | + ```xml |
| 98 | + <meta-data |
| 99 | + android:name="io.sentry.data-collection.http-bodies" |
| 100 | + android:value="incoming_request,outgoing_request,incoming_response,outgoing_response" /> |
| 101 | + <meta-data |
| 102 | + android:name="io.sentry.data-collection.cookies.mode" |
| 103 | + android:value="deny_list" /> |
| 104 | + <meta-data |
| 105 | + android:name="io.sentry.data-collection.cookies.terms" |
| 106 | + android:value="forwarded,-ip,remote-,via,-user" /> |
| 107 | + <meta-data |
| 108 | + android:name="io.sentry.data-collection.http-headers.request.mode" |
| 109 | + android:value="allow_list" /> |
| 110 | + <meta-data |
| 111 | + android:name="io.sentry.data-collection.http-headers.request.terms" |
| 112 | + android:value="content-type,x-request-id" /> |
| 113 | + <meta-data |
| 114 | + android:name="io.sentry.data-collection.url-query-params.mode" |
| 115 | + android:value="off" /> |
| 116 | + <meta-data |
| 117 | + android:name="io.sentry.data-collection.file-paths" |
| 118 | + android:value="false" /> |
| 119 | + ``` |
| 120 | + |
| 121 | + See the [Data Collection documentation](https://docs.sentry.io/platforms/java/configuration/options/#dataCollection) for all configuration keys, supported integrations, and migration guidance. |
| 122 | + |
5 | 123 | ### Fixes |
6 | 124 |
|
7 | 125 | - Disable URL caching when reading `META-INF/MANIFEST.MF` files during version detection so that the SDK no longer keeps jar file handles open for the life of the process ([#6124](https://github.com/getsentry/sentry-java/pull/6124) |
| 126 | +- Keep the `EventListener` wrapped by `SentryOkHttpEventListener` per `Call` ([#6003](https://github.com/getsentry/sentry-java/pull/6003)) |
8 | 127 |
|
9 | 128 | ## 8.57.0 |
10 | 129 |
|
|
47 | 166 |
|
48 | 167 | ### Fixes |
49 | 168 |
|
| 169 | +- Support `ws` and `wss` URL parsing for WebSocket instrumentation ([#6064](https://github.com/getsentry/sentry-java/pull/6064)) |
50 | 170 | - Keep resolving the server name after `Sentry.close()` or a re-init. Closing the SDK shut down the shared hostname cache for the life of the process, so `server_name` silently froze at the value it had last resolved ([#6119](https://github.com/getsentry/sentry-java/pull/6119)) |
51 | 171 | - Order breadcrumbs by the timestamp they carry rather than by when they were created in the current process, so breadcrumbs restored from disk or handed over by a hybrid SDK no longer sort as if they had just happened ([#6097](https://github.com/getsentry/sentry-java/pull/6097)) |
52 | 172 |
|
|
0 commit comments