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

@zuplo/otel

v7.1.7

Published

`@zuplo/otel` instruments your Zuplo API with [OpenTelemetry](https://opentelemetry.io/) — incoming requests, policies, handlers, and outbound `fetch` — and exports the resulting spans to the Zuplo-managed trace ingest and/or to any OTLP/HTTP destination(

Readme

OpenTelemetry for Zuplo

@zuplo/otel instruments your Zuplo API with OpenTelemetry — incoming requests, policies, handlers, and outbound fetch — and exports the resulting spans to the Zuplo-managed trace ingest and/or to any OTLP/HTTP destination(s) you configure.

Getting started

Register the plugin from your project's zuplo.runtime.ts. With no configuration, traces are sent to Zuplo and are queryable in the portal — service.name defaults to your project name:

import { RuntimeExtensions } from "@zuplo/runtime";
import { OpenTelemetryPlugin } from "@zuplo/otel";

export function runtimeInit(runtime: RuntimeExtensions) {
  runtime.addPlugin(new OpenTelemetryPlugin());
}

The Zuplo-managed exporter only works in deployed Zuplo environments. In environments where the managed ingest isn't configured (e.g. local development), using it throws a ConfigurationError — configure your own exporter/spanProcessors, or only add the plugin in deployed environments.

Usage configurations

Zuplo-managed exporter (default)

Omit any destination and spans go to Zuplo. You can still name the service:

new OpenTelemetryPlugin({
  service: { name: "my-api" },
});

This is equivalent to explicitly passing a ZuploSpanExporter:

import { OpenTelemetryPlugin, ZuploSpanExporter } from "@zuplo/otel";

new OpenTelemetryPlugin({
  service: { name: "my-api" },
  exporter: new ZuploSpanExporter(),
});

Your own OTLP collector

Point a single OTLP/HTTP exporter at your collector. Provide headers for authentication. (Using exporter opts out of the Zuplo default.)

import { environment } from "@zuplo/runtime";

new OpenTelemetryPlugin({
  service: { name: "my-api", version: "1.0.0" },
  exporter: {
    url: environment.OTLP_ENDPOINT,
    headers: { authorization: `Bearer ${environment.OTEL_TOKEN}` },
  },
});

Separate logs and traces endpoints

When your backend exposes distinct endpoints for logs and traces, provide both. The shared headers are sent to each.

new OpenTelemetryPlugin({
  service: { name: "my-api" },
  logUrl: environment.OTLP_LOG_ENDPOINT,
  traceUrl: environment.OTLP_TRACE_ENDPOINT,
  headers: { authorization: `Bearer ${environment.OTEL_TOKEN}` },
});

Multiple destinations (Zuplo + your own)

To send spans to more than one destination, build a span processor per destination and pass them as spanProcessors. Each processor batches and flushes independently, so one slow or failing exporter does not block the others. Spans are produced once per request and fan out to every processor.

import {
  OpenTelemetryPlugin,
  OTLPSpanExporter,
  BatchTraceSpanProcessor,
  ZuploSpanExporter,
} from "@zuplo/otel";
import { environment } from "@zuplo/runtime";

new OpenTelemetryPlugin({
  service: { name: "my-api" },
  spanProcessors: [
    // Your own collector
    new BatchTraceSpanProcessor(
      new OTLPSpanExporter({ url: environment.OTLP_ENDPOINT })
    ),
    // ...and Zuplo
    new BatchTraceSpanProcessor(new ZuploSpanExporter()),
  ],
});

spanProcessors accepts any OpenTelemetry SpanProcessor, so you can also mix in standard processors — for example a console exporter for local debugging:

import {
  ConsoleSpanExporter,
  SimpleSpanProcessor,
} from "@opentelemetry/sdk-trace-base";

new OpenTelemetryPlugin({
  service: { name: "my-api" },
  spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())],
});

Resource attributes

Every span is automatically tagged with Zuplo's service, account, project, cloud, and build identifiers. Use resourceAttributes to add your own — they are merged on top of the defaults, so a key you set here overrides the default of the same name.

new OpenTelemetryPlugin({
  service: { name: "my-api" },
  resourceAttributes: {
    "deployment.environment.name": "canary",
  },
});

Sampling

Head sampling is configured via sampling.headSampler. Pass a ratio to sample a fraction of traces (defaults to sampling everything):

new OpenTelemetryPlugin({
  service: { name: "my-api" },
  sampling: {
    headSampler: { ratio: 0.1 }, // sample 10% of requests
  },
});

Exports

| Export | Purpose | | ------------------------- | ------------------------------------------------------------------------- | | OpenTelemetryPlugin | The plugin registered via runtime.addPlugin(...). | | ZuploSpanExporter | Sends spans to the Zuplo-managed trace ingest (the default destination). | | TraceConfig | Type of the plugin's configuration object. | | OTLPSpanExporter | OTLP/HTTP span exporter; pair with a span processor. | | OTLPExporterConfig | Configuration (url, optional headers) for an OTLP exporter. | | BatchTraceSpanProcessor | Per-trace batching span processor; wrap an exporter to add a destination. |