Skip to content

Commit 9703ac9

Browse files
committed
add changelog note
1 parent bf9bb14 commit 9703ac9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7-
Work in this release was contributed by @xgedev, @Mohataseem89, @sebws, @G-Rath, @maximepvrt, and @gianpaj. Thank you for your contributions!
7+
- **feat(core): Apply scope attributes to metrics ([#18738](https://github.com/getsentry/sentry-javascript/pull/18738))**
8+
9+
You can now set attributes on the SDK's scopes which will be applied to all metrics as long as the respective scopes are active. For the time being, only `string`, `number` and `boolean` attribute values are supported.
10+
11+
```ts
12+
Sentry.getGlobalScope().setAttributes({ is_admin: true, auth_provider: 'google' });
13+
14+
Sentry.withScope(scope => {
15+
scope.setAttribute('step', 'authentication');
16+
17+
// scope attributes `is_admin`, `auth_provider` and `step` are added
18+
Sentry.metrics.count('clicks', 1, { attributes: { activeSince: 100 } });
19+
Sentry.metrics.gauge('timeSinceRefresh', 4, { unit: 'hour' });
20+
});
21+
22+
// scope attributes `is_admin` and `auth_provider` are added
23+
Sentry.metrics.count('response_time', 283.33, { unit: 'millisecond' });
24+
```
825

926
- ref(nextjs): Drop `resolve` dependency from the Next.js SDK ([#18618](https://github.com/getsentry/sentry-javascript/pull/18618))
1027

@@ -22,6 +39,8 @@ Work in this release was contributed by @xgedev, @Mohataseem89, @sebws, @G-Rath,
2239

2340
</details>
2441

42+
Work in this release was contributed by @xgedev, @Mohataseem89, @sebws, @G-Rath, @maximepvrt, and @gianpaj. Thank you for your contributions!
43+
2544
## 10.32.0
2645

2746
### Important Changes

0 commit comments

Comments
 (0)