Skip to content

feat(deno): Add denoRuntimeMetricsIntegration - #20023

Merged
chargome merged 11 commits into
developfrom
feat/deno-runtime-metrics
Apr 1, 2026
Merged

feat(deno): Add denoRuntimeMetricsIntegration#20023
chargome merged 11 commits into
developfrom
feat/deno-runtime-metrics

Conversation

@chargome

@chargomechargome commented Mar 27, 2026

Copy link
Copy Markdown
Member

Adds denoRuntimeMetricsIntegration to @sentry/deno that collects runtime health metrics on a configurable interval (default: 30s).


Default metrics (deno.runtime.* prefix):

  • mem.rss — Resident Set Size
  • mem.heap_used — V8 heap in use
  • mem.heap_total — total V8 heap
  • process.uptime — process uptime

Opt-in:memExternal enables mem.external


vs. nodeRuntimeMetricsIntegration: No CPU or event loop metrics — Deno does not expose process.cpuUsage(), performance.eventLoopUtilization(), or monitorEventLoopDelay.

Note: Deno's loadavg() reflects system-wide load across all processes rather than the Deno process itself, which is why we did not include it.

closes https://linear.app/getsentry/issue/JS-1957/runtime-metrics-deno-support

@chargomechargome self-assigned this Mar 27, 2026
@github-actions

github-actionsBot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (deno) Add denoRuntimeMetricsIntegration by chargome in #20023

Internal Changes 🔧

  • (core) Remove provider-specific AI span attributes in favor of gen_ai attributes in sentry conventions by nicohrubec in #20011

🤖 This preview updates automatically when you update the PR.

@linear-code

Copy link
Copy Markdown

@github-actions

github-actionsBot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

PathSize% ChangeChange
@sentry/browser25.64 kB--
@sentry/browser - with treeshaking flags24.13 kB--
@sentry/browser (incl. Tracing)42.15 kB+0.01%+1 B 🔺
@sentry/browser (incl. Tracing, Profiling)46.76 kB--
@sentry/browser (incl. Tracing, Replay)80.94 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags70.56 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)85.65 kB+0.01%+1 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)97.91 kB--
@sentry/browser (incl. Feedback)42.42 kB--
@sentry/browser (incl. sendFeedback)30.3 kB--
@sentry/browser (incl. FeedbackAsync)35.28 kB--
@sentry/browser (incl. Metrics)26.95 kB--
@sentry/browser (incl. Logs)27.1 kB--
@sentry/browser (incl. Metrics & Logs)27.77 kB--
@sentry/react27.41 kB--
@sentry/react (incl. Tracing)44.48 kB--
@sentry/vue30.08 kB--
@sentry/vue (incl. Tracing)44.05 kB+0.01%+2 B 🔺
@sentry/svelte25.66 kB--
CDN Bundle28.32 kB+0.01%+1 B 🔺
CDN Bundle (incl. Tracing)43.1 kB--
CDN Bundle (incl. Logs, Metrics)29.68 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)44.16 kB+0.01%+1 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)68.48 kB+0.01%+1 B 🔺
CDN Bundle (incl. Tracing, Replay)80 kB+0.01%+1 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)81.04 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)85.54 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)86.58 kB--
CDN Bundle - uncompressed82.66 kB--
CDN Bundle (incl. Tracing) - uncompressed127.81 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed86.81 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed131.22 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed209.79 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed244.68 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed248.08 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed257.59 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed260.98 kB--
@sentry/nextjs (client)46.89 kB+0.01%+1 B 🔺
@sentry/sveltekit (client)42.62 kB--
@sentry/node-core55.76 kB+0.02%+8 B 🔺
@sentry/node172.76 kB+0.01%+11 B 🔺
@sentry/node - without tracing96.02 kB+0.01%+6 B 🔺
@sentry/aws-serverless112.78 kB+0.01%+7 B 🔺

View base workflow run

@github-actions

github-actionsBot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

ScenarioRequests/s% of BaselinePrev. Requests/sChange %
GET Baseline9,150-9,026+1%
GET With Sentry1,75019%1,695+3%
GET With Sentry (error only)6,09567%6,154-1%
POST Baseline1,211-1,210+0%
POST With Sentry59549%595-
POST With Sentry (error only)1,05187%1,066-1%
MYSQL Baseline3,296-3,232+2%
MYSQL With Sentry50915%441+15%
MYSQL With Sentry (error only)2,64780%2,682-1%

View base workflow run

@chargome
chargome marked this pull request as ready for review March 30, 2026 12:32
Comment threadpackages/deno/src/integrations/denoRuntimeMetrics.ts Outdated
chargome added a commit to getsentry/sentry-docs that referenced this pull request Mar 30, 2026
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>
Comment threadpackages/deno/src/integrations/denoRuntimeMetrics.ts Outdated
…erval
Global setInterval in Deno returns a number at runtime, not NodeJS.Timeout.
_INTERNAL_safeUnref is a no-op for numbers (it checks typeof timer === 'object').
Use Deno.unrefTimer directly instead, with a type cast to work around @types/node
polluting the global setInterval signature in the monorepo.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chargome added a commit to getsentry/sentry-docs that referenced this pull request Mar 31, 2026
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>
@chargome
chargome requested review from a team, Lms24, andreiborza, nicohrubec and stephanie-anderson and removed request for a team and stephanie-andersonMarch 31, 2026 13:14
@chargomechargome changed the title feat(deno): add denoRuntimeMetricsIntegrationfeat(deno): Add denoRuntimeMetricsIntegrationMar 31, 2026
Comment threadpackages/deno/src/integrations/denoRuntimeMetrics.ts Outdated
Sub-second collection intervals provide no practical observability value
and would cause unnecessary CPU overhead from tight Deno.memoryUsage() calls.
Clamp to 1000ms and warn so misconfigured integrations are visible.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment threadpackages/deno/src/integrations/denoRuntimeMetrics.ts Outdated
Comment threadpackages/deno/src/integrations/denoRuntimeMetrics.ts
chargomeand others added 3 commits March 31, 2026 16:24
…clamp
NaN < 1000 evaluates to false (skipping the warning) and Math.max(NaN, 1000)
returns NaN, causing setInterval(fn, NaN) to fire at near-zero interval.
Use Number.isFinite to catch NaN and Infinity before applying Math.max.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Oxlint flags bare console.* references as errors. Use globalThis.console
to bypass the rule while still intercepting the integration's warnings.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chargome
chargome merged commit b29d628 into developApr 1, 2026
38 checks passed
@chargome
chargome deleted the feat/deno-runtime-metrics branch April 1, 2026 08:16
chargome added a commit to getsentry/sentry-docs that referenced this pull request Apr 20, 2026
## DESCRIBE YOUR PR
Document the new `denoRuntimeMetricsIntegration` added in
getsentry/sentry-javascript#20023.
Documents getsentry/sentry-javascript#20023
- Add integration documentation page with default/opt-in metrics table
and configuration options
- Add integration to the Deno platform integration table
## IS YOUR CHANGE URGENT?
- [ ] Urgent deadline (GA date, etc.)
- [ ] Other deadline
- [x] None: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!
## PRE-MERGE CHECKLIST
- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sentrivana pushed a commit to getsentry/sentry-docs that referenced this pull request May 18, 2026
## DESCRIBE YOUR PR
Document the new `denoRuntimeMetricsIntegration` added in
getsentry/sentry-javascript#20023.
Documents getsentry/sentry-javascript#20023
- Add integration documentation page with default/opt-in metrics table
and configuration options
- Add integration to the Deno platform integration table
## IS YOUR CHANGE URGENT?
- [ ] Urgent deadline (GA date, etc.)
- [ ] Other deadline
- [x] None: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!
## PRE-MERGE CHECKLIST
- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@chargome@nicohrubec