# Fixing JavaScript observability, one library at a time

[Sentry](https://yomu.fyi/company/sentry) · Abdelrahman Awad · May 7, 2026

**Type:** Problem & solution

## Summary

JavaScript application performance monitoring tools rely on monkey-patching via require-in-the-middle and import-in-the-middle, which breaks with ECMAScript Modules, bundlers, and non-Node runtimes. To solve this, an initiative is replacing monkey-patching with Node's built-in diagnostics\_channel TracingChannel API across server-side JavaScript libraries. Under this pattern, libraries publish structured events while monitoring vendors subscribe to them with zero overhead when unlistened. The author leveraged Claude Code workflows alongside direct maintainer communication to draft proposals, implement code, and manage reviews across 44 target packages. Ten libraries including mysql2, node-redis, ioredis, and unjs modules have merged support, while active efforts continue on shared OpenTelemetry mapper registries and remaining ecosystem packages.

## Context

JavaScript APM tools rely on runtime monkey-patching via IITM and RITM, which causes fragility with ECMAScript Modules, strict initialization ordering, bundlers, and non-Node runtimes like Bun and Deno.

## Approach / What changed

Migrating ecosystem libraries to emit native structured events via Node's diagnostics\_channel TracingChannel API, using Claude Code to handle research, boilerplate implementation, and review triage across 44 libraries.

## Takeaways

- TracingChannel operates with zero overhead when no subscribers are listening, works across Node, Bun, and Deno, and avoids loader hooks or bundler conflicts.
- Adoption is progressing across 44 tracked libraries, with 10 already merged, including mysql2, node-redis, ioredis, h3, srvx, and unstorage.
- A planned shared mapper registry will translate TracingChannel events into standardized OpenTelemetry semantic conventions so multiple APM vendors avoid duplicated consumer mapping.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Developer Experience](https://yomu.fyi/topic/developer-experience), [Monitoring](https://yomu.fyi/topic/monitoring), [Observability](https://yomu.fyi/topic/observability), [Open Source](https://yomu.fyi/topic/open-source)

[Read original post](https://blog.sentry.io/fixing-javascript-observability)
