Skip to content

Commit fd4d256

Browse files
chargomeclaude
andcommitted
docs(deno): Add denoRuntimeMetricsIntegration documentation
Document the new denoRuntimeMetricsIntegration for collecting Deno runtime health metrics (memory, uptime). Ref: getsentry/sentry-javascript#20023 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3f9b1ab commit fd4d256

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: DenoRuntimeMetrics
3+
description: "Collect Deno runtime health metrics such as memory usage and process uptime."
4+
supported:
5+
- javascript.deno
6+
---
7+
8+
<Alert>
9+
10+
This integration only works in the Deno runtime.
11+
12+
</Alert>
13+
14+
_Import name: `Sentry.denoRuntimeMetricsIntegration`_
15+
16+
The `denoRuntimeMetricsIntegration` periodically collects Deno runtime health metrics and sends them to Sentry. Metrics include memory usage and process uptime.
17+
18+
```javascript
19+
import * as Sentry from "@sentry/deno";
20+
21+
Sentry.init({
22+
dsn: "___PUBLIC_DSN___",
23+
integrations: [Sentry.denoRuntimeMetricsIntegration()],
24+
});
25+
```
26+
27+
## Default Metrics
28+
29+
The following metrics are emitted every 30 seconds by default:
30+
31+
| Metric | Type | Unit | Description |
32+
| ------------------------------ | ------- | ------ | ---------------------------------------------------- |
33+
| `deno.runtime.mem.rss` | gauge | byte | Resident Set Size — actual process memory footprint |
34+
| `deno.runtime.mem.heap_used` | gauge | byte | V8 heap currently in use |
35+
| `deno.runtime.mem.heap_total` | gauge | byte | Total V8 heap allocated |
36+
| `deno.runtime.process.uptime` | counter | second | Cumulative process uptime |
37+
38+
<Alert>
39+
40+
Unlike the Node.js equivalent, CPU and event loop metrics are not available because Deno does not expose `process.cpuUsage()`, `performance.eventLoopUtilization()`, or `monitorEventLoopDelay`.
41+
42+
</Alert>
43+
44+
## Options
45+
46+
### `collect`
47+
48+
_Type: `object`_
49+
50+
Configure which metrics to collect. You can enable opt-in metrics or disable default ones.
51+
52+
**Opt-in metrics (off by default):**
53+
54+
```javascript
55+
Sentry.denoRuntimeMetricsIntegration({
56+
collect: {
57+
memExternal: true, // deno.runtime.mem.external
58+
},
59+
});
60+
```
61+
62+
**Disabling default metrics:**
63+
64+
```javascript
65+
Sentry.denoRuntimeMetricsIntegration({
66+
collect: {
67+
uptime: false,
68+
},
69+
});
70+
```
71+
72+
### `collectionIntervalMs`
73+
74+
_Type: `number`_
75+
76+
The interval in milliseconds between metric collections. Defaults to `30000` (30 seconds).
77+
78+
```javascript
79+
Sentry.denoRuntimeMetricsIntegration({
80+
collectionIntervalMs: 60_000,
81+
});
82+
```

platform-includes/configuration/integrations/javascript.deno.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
| [`linkedErrorsIntegration`](./linkederrors) ||| | | |
1313
| [`captureConsoleIntegration`](./captureconsole) | | | | ||
1414
| [`denoCronIntegration`](./denocron) | | | || |
15+
| [`denoRuntimeMetricsIntegration`](./denoruntimemetrics) | | | | ||
1516
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
1617
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |
1718
| [`supabaseIntegration`](./supabase) | ||| | |

0 commit comments

Comments
 (0)