npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@unhandled/otel-lean

v0.2.5

Published

Unhandled span processors, instrumentations, @adonisjs/otel destinations and analytics for apps that run their own OpenTelemetry SDK

Readme

@unhandled/otel-lean

The Unhandled pieces for apps that run their own OpenTelemetry SDK, such as AdonisJS apps on @adonisjs/otel. It depends only on @unhandled/protocol; the OpenTelemetry packages are peers, so it uses the copies your SDK already loads and installs no second SDK.

Install

pnpm add @unhandled/otel-lean @opentelemetry/[email protected]

Pin @opentelemetry/instrumentation to the version your SDK uses (0.213.0 for @adonisjs/otel 1.2.4). Without the pin, npm and pnpm install the newest 0.2xx release beside it.

@adonisjs/otel

// config/otel.ts
import { defineConfig } from '@adonisjs/otel'
import { unhandledDestinations, unhandledSpanProcessors } from '@unhandled/otel-lean/otel_preset'
import { KNEX_POOL_WAIT_INSTRUMENTATION_NAME, KnexPoolWaitInstrumentation } from '@unhandled/otel-lean/knex_pool_wait'
import env from '#start/env'

const destinations = unhandledDestinations({ dsn: env.get('UNHANDLED_DSN'), environment: env.get('APP_ENV') })

export default defineConfig({
  destinations,
  instrumentations: { [KNEX_POOL_WAIT_INSTRUMENTATION_NAME]: new KnexPoolWaitInstrumentation() },
  spanProcessors: unhandledSpanProcessors({ destinations }),
})

unhandledDestinations() turns the DSN into an @adonisjs/otel destination. Without a DSN it returns none, and @adonisjs/otel falls back to the OTEL_EXPORTER_OTLP_* variables.

Passing destinations switches export away from the OTEL_* variables: the OpenTelemetry Node SDK builds no exporter from OTEL_EXPORTER_OTLP_* once a destination supplies its own. If your .env has both UNHANDLED_DSN and OTEL_* variables, everything goes to the DSN and the OTEL_* endpoint receives nothing.

[!WARNING] Don't pass spanProcessors: [new ExecutionContextProcessor()] on its own. When spanProcessors is set, the Node SDK skips the trace exporter it builds from the OTEL_* variables, so an app without a DSN destination stops exporting traces and nothing reports it. unhandledSpanProcessors() returns the ExecutionContextProcessor plus that exporter, built from OTEL_TRACES_EXPORTER, OTEL_EXPORTER_OTLP_PROTOCOL and the endpoint and header variables the way the SDK would build it. It leaves the exporter out when a destination already takes traces or OTEL_SDK_DISABLED=true.

Subpaths

| Import | Exports | | --- | --- | | @unhandled/otel-lean/otel_preset | unhandledDestinations, unhandledSpanProcessors and everything below except the error class | | @unhandled/otel-lean/execution_context | ExecutionContextProcessor, which marks every span web or background | | @unhandled/otel-lean/knex_pool_wait | KnexPoolWaitInstrumentation, which puts the knex pool wait on the query span as db.client.connection.wait_time | | @unhandled/otel-lean/clickhouse | ClickHouseInstrumentation for @clickhouse/client | | @unhandled/otel-lean/errors | UnhandledConfigError |

Both instrumentations stay off until the SDK registers them (registerInstrumentations, which NodeSDK.start() calls), so a config file that builds them under OTEL_SDK_DISABLED=true hooks nothing.

For AI agents

A coding agent can install this package, check that its data arrives and fix the errors it reports through the Unhandled MCP server at https://unhandled.net/mcp. In Claude Code, the Unhandled plugin adds that server plus skills for instrumenting a service, fixing a production error with a failing test first and verifying a deploy:

claude plugin marketplace add treboryx/unhandled
claude plugin install unhandled@unhandled

Codex, Cursor, Gemini CLI and other agents connect to the same URL. Coding agents has the setup for each one and an AGENTS.md section to add to your repository.