Skip to content

Commit 2a56f20

Browse files
committed
feat: Add support for Sentry Metrics
1 parent 40616d2 commit 2a56f20

File tree

12 files changed

+467
-124
lines changed

12 files changed

+467
-124
lines changed

CHANGELOG.md

Lines changed: 64 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
## 7.3.0
66

7-
- feat: Update JavaScript SDKs from [v10.17.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.17.0) to [v10.22.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.22.0)
7+
- feat: Update JavaScript SDKs from [v10.17.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.17.0) to
8+
[v10.25.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.25.0)
9+
- feat: Add support for [Sentry Metrics](https://docs.sentry.io/product/metrics/)
810

911
## 7.2.0
1012

11-
- feat: Update JavaScript SDKs from [v10.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.11.0) to [v10.17.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.17.0)
13+
- feat: Update JavaScript SDKs from [v10.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.11.0) to
14+
[v10.17.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.17.0)
1215
- feat: Log os and device attributes (#1246)
1316

1417
## 7.1.1
@@ -19,163 +22,151 @@
1922

2023
## 7.1.0
2124

22-
- feat: Update JavaScript SDKs from [v10.7.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.7.0) to [v10.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.11.0) (#1236)
25+
- feat: Update JavaScript SDKs from [v10.7.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.7.0) to
26+
[v10.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.11.0) (#1236)
2327
- feat: Optional Namespaced IPC (#1234)
2428
- fix: Export `ErrorEvent` type (#1229)
2529
- fix: Only capture logs if `enableLogs` is true (#1235)
2630

2731
## 7.0.0
2832

29-
This release updates the underlying Sentry JavaScript SDKs to v10 which includes
30-
some breaking changes. Check out the the [migration guide](./MIGRATION.md) for
31-
more details.
33+
This release updates the underlying Sentry JavaScript SDKs to v10 which includes some breaking changes. Check out the
34+
the [migration guide](./MIGRATION.md) for more details.
3235

3336
- feat: Update JavaScript SDKs to v10.8.0 (#1205)
3437

3538
## 6.11.0
3639

37-
- feat: Update JavaScript SDKs from [v9.45.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.45.0) to [v9.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.46.0)
40+
- feat: Update JavaScript SDKs from [v9.45.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.45.0) to
41+
[v9.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.46.0)
3842
- fix: Ensure native directory ends up in package (#1216)
3943

4044
## 6.10.0
4145

42-
- feat: Update JavaScript SDKs from [v9.43.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.43.0) to [v9.45.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.45.0)
46+
- feat: Update JavaScript SDKs from [v9.43.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.43.0) to
47+
[v9.45.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.45.0)
4348
- fix: Don't use `deepmerge` to merge events to remove circular ref. issues (#1210)
4449
- fix: Support `node16` for TypeScript `moduleResolution` (#1203)
4550

4651
## 6.9.0
4752

48-
- feat: Update JavaScript SDKs from
49-
[v9.26.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.26.0)
50-
to
53+
- feat: Update JavaScript SDKs from [v9.26.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.26.0) to
5154
[v9.43.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.43.0)
5255
- feat: Add `eventLoopBlockIntegration` (#1188)
5356
- feat: Move renderer event loop block detection to an integration (#1196)
5457

5558
## 6.8.0
5659

57-
- feat: Update JavaScript SDKs from [v9.25.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.25.0) to [v9.26.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.26.0)
60+
- feat: Update JavaScript SDKs from [v9.25.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.25.0) to
61+
[v9.26.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.26.0)
5862
- fix: Don't capture stack traces from destroyed renderers (#1165)
5963

6064
## 6.7.0
6165

62-
- feat: Update JavaScript SDKs from [v9.18.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.18.0) to [v9.25.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.25.0)
66+
- feat: Update JavaScript SDKs from [v9.18.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.18.0) to
67+
[v9.25.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.25.0)
6368
- feat: Add structured logging support (#1159)
6469

6570
## 6.6.0
6671

67-
- feat: Update JavaScript SDKs from [v9.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.11.0) to [v9.18.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.18.0)
72+
- feat: Update JavaScript SDKs from [v9.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.11.0) to
73+
[v9.18.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.18.0)
6874

6975
## 6.5.0
7076

71-
- feat: Update JavaScript SDKs from [v9.10.1](https://github.com/getsentry/sentry-javascript/releases/tag/9.10.1) to [v9.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.11.0)
77+
- feat: Update JavaScript SDKs from [v9.10.1](https://github.com/getsentry/sentry-javascript/releases/tag/9.10.1) to
78+
[v9.11.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.11.0)
7279
- fix: GPU context should use id rather than device_id (#1126)
7380
- feat: Optionally capture manufacturer and model device context (#1125)
7481

7582
## 6.4.0
7683

77-
- feat: Update JavaScript SDKs from [v9.8.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.8.0) to [v9.10.1](https://github.com/getsentry/sentry-javascript/releases/tag/9.10.1)
84+
- feat: Update JavaScript SDKs from [v9.8.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.8.0) to
85+
[v9.10.1](https://github.com/getsentry/sentry-javascript/releases/tag/9.10.1)
7886
- fix: Missing Dynamic Sampling Context in envelope header for renderer tracing (#1117)
7987
- feat: Use `frame.collectJavaScriptCallStack()` for renderer ANR in Electron >= v34 (#1105)
8088

8189
## 6.3.0
8290

83-
- feat: Update JavaScript SDKs from [v9.6.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.6.0) to [v9.8.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.8.0)
91+
- feat: Update JavaScript SDKs from [v9.6.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.6.0) to
92+
[v9.8.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.8.0)
8493
- fix: Electron app.getPath('crashDumps') API can throw (#1106)
8594

8695
## 6.2.0
8796

88-
- feat: Update JavaScript SDKs from [v9.1.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.1.0) to [v9.6.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.6.0)
97+
- feat: Update JavaScript SDKs from [v9.1.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.1.0) to
98+
[v9.6.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.6.0)
8999
- feat: Use new `registerPreloadScript` API in Electron >= v35 (#1098)
90100
- feat: Add `gpuContextIntegration` (#1097)
91-
- feat: Parse crashpad metadata from minidumps and include in electron context
92-
(#1095)
101+
- feat: Parse crashpad metadata from minidumps and include in electron context (#1095)
93102

94103
## 6.1.0
95104

96-
- feat: Update JavaScript SDKs from [v9.0.1](https://github.com/getsentry/sentry-javascript/releases/tag/9.0.1) to [v9.1.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.1.0) (#1080)
105+
- feat: Update JavaScript SDKs from [v9.0.1](https://github.com/getsentry/sentry-javascript/releases/tag/9.0.1) to
106+
[v9.1.0](https://github.com/getsentry/sentry-javascript/releases/tag/9.1.0) (#1080)
97107
- feat: Support `@sentry/profiling-node` (#1084)
98108
- fix: Renderer ANR detection (#1083)
99109

100110
## 6.0.0
101111

102-
This release updates the underlying Sentry JavaScript SDKs to v9 which includes
103-
some breaking changes. Check out the the [migration guide](./MIGRATION.md) for
104-
more details.
112+
This release updates the underlying Sentry JavaScript SDKs to v9 which includes some breaking changes. Check out the the
113+
[migration guide](./MIGRATION.md) for more details.
105114

106115
- feat: Update JavaScript SDKs to v9.0.0 (#1072)
107116

108117
### Supported Electron Versions
109118

110-
The Sentry Node SDK now requires Node >= 18.0.0 which means the Sentry Electron
111-
SDK now supports Electron >= 23.0.0.
119+
The Sentry Node SDK now requires Node >= 18.0.0 which means the Sentry Electron SDK now supports Electron >= 23.0.0.
112120

113121
### The `autoSessionTracking` option has been removed
114122

115-
Whereas in v5, session tracking was disabled by setting `autoSessionTracking` to
116-
`false`, in v6 session tracking can be disabled by removing the `MainProcessSession` integration
123+
Whereas in v5, session tracking was disabled by setting `autoSessionTracking` to `false`, in v6 session tracking can be
124+
disabled by removing the `MainProcessSession` integration
117125

118126
```javascript
119-
import * as Sentry from "@sentry/electron/main";
127+
import * as Sentry from '@sentry/electron/main';
120128

121129
Sentry.init({
122-
dsn: "__DSN__",
130+
dsn: '__DSN__',
123131
// autoSessionTracking: false,
124-
integrations: (defaults) => defaults.filter((i) => i.name !== "MainProcessSession"),
132+
integrations: (defaults) => defaults.filter((i) => i.name !== 'MainProcessSession'),
125133
});
126134
```
127135

128136
## 5.11.0
129137

130-
- feat: Update from
131-
[v8.48.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.48.0)
132-
to
133-
[v8.51.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.51.0)
134-
(#1066)
135-
- fix: Returing `null` in `beforeSend` for native crashes should not impact
136-
release health (#1066)
138+
- feat: Update from [v8.48.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.48.0) to
139+
[v8.51.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.51.0) (#1066)
140+
- fix: Returing `null` in `beforeSend` for native crashes should not impact release health (#1066)
137141
- feat: Set log level for `net` breadcrumbs based on status code (#1070)
138142
- test: Test more child process types (#1063)
139143

140144
## 5.10.0
141145

142-
- fix: Deprecate renderer init options which should only be used in main process
143-
(#1044)
144-
- feat: Update from
145-
[v8.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.46.0)
146-
to
147-
[v8.48.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.48.0)
148-
of JavaScript SDKs (#1046)
146+
- fix: Deprecate renderer init options which should only be used in main process (#1044)
147+
- feat: Update from [v8.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.46.0) to
148+
[v8.48.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.48.0) of JavaScript SDKs (#1046)
149149
- feat: Determine Electron process from minidump metadata (#1049)
150150
- fix: Guard against invalid queue entries (#1053)
151151

152152
## 5.9.0
153153

154-
- feat: Update from
155-
[v8.42.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.42.0)
156-
to
157-
[v8.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.46.0)
158-
of JavaScript SDKs
154+
- feat: Update from [v8.42.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.42.0) to
155+
[v8.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.46.0) of JavaScript SDKs
159156
- fix: Disable ANR when screen locked (#1036)
160157
- fix: Disable ANR when debugger is in use
161158

162159
## 5.8.0
163160

164-
- feat: Update from
165-
[v8.35.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.35.0)
166-
to
167-
[v8.42.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.42.0)
168-
of JavaScript SDKs
161+
- feat: Update from [v8.35.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.35.0) to
162+
[v8.42.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.42.0) of JavaScript SDKs
169163
- fix: Sync global scope to main process (#1024)
170164
- fix: contextLinesIntegration should come before path normalization (#1008)
171165

172166
## 5.7.0
173167

174-
- feat: Update from
175-
[v8.33.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.33.0)
176-
to
177-
[v8.35.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.35.0)
178-
of JavaScript SDKs
168+
- feat: Update from [v8.33.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.33.0) to
169+
[v8.35.0](https://github.com/getsentry/sentry-javascript/releases/tag/8.35.0) of JavaScript SDKs
179170

180171
## 5.6.0
181172

@@ -291,7 +282,7 @@ For the full list of changes, see the [migration guide](./MIGRATION.md).
291282

292283
- feat: Renderer process ANR detection with stack traces (#770)
293284
- Update from [v7.73.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.73.0) to
294-
[v7.74.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.74.0) of JavaScript SDKs
285+
[v7.74.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.74.0) of JavaScript SDKs
295286
- fix: Hide ANR child process from dock (#777)
296287
- test: Electron v28 main process ESM (#773)
297288

@@ -320,29 +311,31 @@ fix: Don't send minidumps that are too small to be valid (#748)
320311
[v7.68.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.68.0) of JavaScript SDKs (#738)
321312
- **feat: Mark errors caught by the SDK as unhandled**
322313

323-
As per the changes in the JavaScript SDKs [for
324-
v7.67.0](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7670), this release fixes inconsistent
325-
behaviour of when our SDKs classify captured errors as unhandled. Previously, some of our instrumentations correctly set
326-
unhandled, while others set handled.
314+
As per the changes in the JavaScript SDKs
315+
[for v7.67.0](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7670), this release fixes
316+
inconsistent behaviour of when our SDKs classify captured errors as unhandled. Previously, some of our instrumentations
317+
correctly set unhandled, while others set handled.
327318

328-
Going forward, all errors caught automatically from our SDKs will be marked as unhandled.
329-
If you manually capture errors (e.g. by calling `Sentry.captureException`), your errors will continue to be reported as handled.
319+
Going forward, all errors caught automatically from our SDKs will be marked as unhandled. If you manually capture errors
320+
(e.g. by calling `Sentry.captureException`), your errors will continue to be reported as handled.
330321

331-
This change might lead to a decrease in reported crash-free sessions and consequently in your release health score.
332-
If you have concerns about this, feel free to open an issue.
322+
This change might lead to a decrease in reported crash-free sessions and consequently in your release health score. If
323+
you have concerns about this, feel free to open an issue.
333324

334325
## 4.10.0
335326

336327
- feat: Optionally send sessions when they're created (#715)
337-
- feat: Update from [v7.61.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.61.0) to [v7.63.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.63.0) of JavaScript SDKs (#719)
328+
- feat: Update from [v7.61.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.61.0) to
329+
[v7.63.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.63.0) of JavaScript SDKs (#719)
338330

339331
## 4.9.0
340332

341333
- fix: Ensure context from previous run is used for native main crashes (#683)
342334
- feat: Tracing without performance (#710)
343335
- feat: Deprecate `tracingOrigins` for `tracePropagationTargets` (#703)
344336
- feat: Use `protocol.handle` on Electron >= v25 (#704)
345-
- test: Update from [v7.58.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.58.0) to [v7.61.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.61.0) of JavaScript SDKs (#709)
337+
- test: Update from [v7.58.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.58.0) to
338+
[v7.61.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.61.0) of JavaScript SDKs (#709)
346339

347340
## 4.8.0
348341

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@
105105
"e2e": "xvfb-maybe vitest run --root=./test/e2e --silent=false --disable-console-intercept"
106106
},
107107
"dependencies": {
108-
"@sentry/browser": "10.22.0",
109-
"@sentry/core": "10.22.0",
110-
"@sentry/node": "10.22.0"
108+
"@sentry/browser": "10.25.0",
109+
"@sentry/core": "10.25.0",
110+
"@sentry/node": "10.25.0"
111111
},
112112
"peerDependencies": {
113-
"@sentry/node-native": "10.22.0"
113+
"@sentry/node-native": "10.25.0"
114114
},
115115
"peerDependenciesMeta": {
116116
"@sentry/node-native": {

src/common/ipc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SerializedLog } from '@sentry/core';
1+
import { SerializedLog, SerializedMetric } from '@sentry/core';
22

33
/** Ways to communicate between the renderer and main process */
44
export enum IPCMode {
@@ -25,7 +25,9 @@ export type Channel =
2525
/** IPC to pass renderer status updates */
2626
| 'status'
2727
/** IPC to pass structured log messages */
28-
| 'structured-log';
28+
| 'structured-log'
29+
/** IPC to pass metric data */
30+
| 'metric';
2931

3032
export interface IpcUtils {
3133
createUrl: (channel: Channel) => string;
@@ -85,6 +87,7 @@ export interface IPCInterface {
8587
sendEnvelope: (evn: Uint8Array | string) => void;
8688
sendStatus: (state: RendererStatus) => void;
8789
sendStructuredLog: (log: SerializedLog) => void;
90+
sendMetric: (metric: SerializedMetric) => void;
8891
}
8992

9093
export const RENDERER_ID_HEADER = 'sentry-electron-renderer-id';

0 commit comments

Comments
 (0)