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

nitro-opentelemetry

v0.10.2

Published

Opentelemetry module for the server framework nitro. Compatible with Nuxt.

Readme

nitro-opentelemetry

npm version npm downloads

ℹ️ Opentelemetry integration is going to be built-in in a future version of nitro. This module does not reflect the future API of the official integration of nitro OTEL.

Opentelemetry integration for nitro. Without patching nitro.

This nitro module automatically create spans for request and error happening in your nitro server.

Usage

Install package:

# ✨ Auto-detect
npx nypm install nitro-opentelemetry

# npm
npm install nitro-opentelemetry

# yarn
yarn add nitro-opentelemetry

# pnpm
pnpm add nitro-opentelemetry

# bun
bun install nitro-opentelemetry

# deno
deno install npm:nitro-opentelemetry

Add the module:

//https://nitro.unjs.io/config
export default defineNitroConfig({
  modules: [
    'nitro-opentelemetry'
  ]
});

This module is also compatible with Nuxt

export default defineNuxtConfig({
  modules: [
    'nitro-opentelemetry'
  ]
})

Build-time

Config

You can configure the module with the otel property in your nitro.config.ts

  • preset:
    • Option to configure the preset that will be used with OTEL

Presets

nitro-opentelemetry provides a list of presets. Theses presets are files that initialize the SDK for OTEL (for example the NodeSDK). You can provide your own by setting:

{
  name: 'custom',
  filePath: 'path_to_your_file'
}

on the preset option in the otel config.

Runtime

Span

A span is created for each event.

It is attached to the event object with the span property. The context associated to the span is also available within H3Event

interface H3Event {
    otel: {
      span: Span
      ctx: Context
    }
}

You can manipulate this span until it ends. The span will be ended in afterResponse (nitro hook) with the endTime set in beforeReponse (nitro hook). In case of an error, if there is an event associated to the error, the span will record the exception and end. If not, nitro-opentelemetry will create a span from the ROOT_CONTEXT and end it.

Hooks

Here are the available hooks.

interface NitroRuntimeHooks {
    'otel:span:name': (context: { event: H3Event, name: undefined|string }) => void
    'otel:span:end': (context: { event: H3Event, span: Span }) => void
}
  • otel:span:name

    • Called when a span is created.
  • otel:span:end

    • Called before ending a Span. This can happen in the afterResponse hook or in the error hook.
  • otel:recordException:before

    • Called before recording and exception within the error hook of nitro. Can be used to not record an exception if you don't want to use a SpanProcessor.

Utils

defineTracedEventHandler

  • Wrap your event handler with the span assigned to your event. This avoid loosing the context for opentelemetry. The main renderer and error renderer doesn't need to be wrapped with defineTracedEventHandler

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Published under the MIT license. Made by @huang-julien and community 💛


🤖 auto updated with automd