Skip to content

Commit 75fd1d5

Browse files
nicohrubecclaudeLms24
authored
chore(changelog): clarify array attributes impact on beforeSend* callbacks (#21186)
The last release shipped array attribute support, which can subtly break user hooks if users have special treatment for these. Update the changelog to be a bit more explicit about this behavioral change. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
1 parent 8a2a490 commit 75fd1d5

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,28 @@
3030

3131
### Important Changes
3232

33+
- **feat(core): Support array attributes for spans, logs, and metrics ([#20427](https://github.com/getsentry/sentry-javascript/pull/20427))**
34+
35+
Arrays of primitive values (`string`, `number`, `boolean`) are now accepted as attribute values. Arrays containing non-primitive elements will be dropped and won't show up in Sentry. Array attributes on logs and metrics were previously stringified and will now be sent as actual arrays instead. **If you have custom rules that process attribute values in any `beforeSend*` callbacks (e.g., data scrubbing), you may need to update them to correctly handle array values.**
36+
37+
For instance, here's how you can update a `beforeSendLog` callback to handle arrays:
38+
39+
```ts
40+
beforeSendLog: log => {
41+
const attributes = log.attributes;
42+
Object.keys(attributes).forEach(key => {
43+
const value = attributes[key];
44+
if (typeof value === 'string') {
45+
attributes[key] = scrubData(value);
46+
}
47+
if (Array.isArray(value)) {
48+
attributes[key] = value.map(v => (typeof v === 'string' ? scrubData(v) : v));
49+
}
50+
});
51+
return log;
52+
};
53+
```
54+
3355
- **feat(browser): Add `fetchStreamPerformanceIntegration` for streamed response tracking ([#20778](https://github.com/getsentry/sentry-javascript/pull/20778))**
3456

3557
A new integration that tracks the performance of streamed fetch responses. Use this to measure time-to-first-byte and streaming duration for APIs that return chunked/streamed data. This replaces the now deprecated `trackFetchStreamPerformance` option.
@@ -38,10 +60,6 @@
3860

3961
Adds a new `dataCollection` client option for controlling what data the SDK collects and sends to Sentry. This provides a centralized way to configure data collection behavior across different SDK features. In the future, this option will be used for fine-granular data filtering, while the simple `sendDefaultPii` boolean option will be deprecated and removed in a future release.
4062

41-
- **feat(core): Support array attributes for spans, logs, and metrics ([#20427](https://github.com/getsentry/sentry-javascript/pull/20427))**
42-
43-
Arrays of primitive values (`string`, `number`, `boolean`) are now accepted as attribute values. Arrays containing non-primitive elements will be dropped and won't show up in Sentry. Note that array attributes on logs and metrics were previously stringified in certain cases and will now be sent as arrays instead.
44-
4563
- **feat(hono): Add `hono.request` spans for internal `.request()` calls ([#20843](https://github.com/getsentry/sentry-javascript/pull/20843))**
4664

4765
The Hono SDK now creates spans for internal `.request()` calls, providing better visibility into request handling within Hono applications.

0 commit comments

Comments
 (0)