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

@openknot-ts/opentelemetry-tracing

v0.0.6-preview

Published

Optional OpenTelemetry API instrumentation for OpenKnot Flow.

Readme

@openknot-ts/opentelemetry-tracing

Implements OpenKnot's tracing API over the standard OpenTelemetry JavaScript API. It maps the neutral span fields (kind, root, propagation, attributes, failure) and depends on neither Flow nor an SDK: the application chooses the SDK, provider, sampler, exporter and their lifecycle.

The only peer is @opentelemetry/api >=1.9.0 <2. The root entry runs without Wire; /wire composes it as a module.

Usage

Let the module own the SDK's lifecycle:

import { provideOpenTelemetry } from "@openknot-ts/opentelemetry-tracing/wire";
import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
import { W3CTraceContextPropagator } from "@opentelemetry/core";
import { ConsoleSpanExporter, SimpleSpanProcessor, TracerProvider } from "@opentelemetry/sdk-trace";

const observability = provideOpenTelemetry({
  initialize: async (_dependencies, { signal }) => {
    signal.throwIfAborted();

    const provider = new TracerProvider({
      spanProcessors: [new SimpleSpanProcessor({ exporter: new ConsoleSpanExporter() })],
    });
    const context = new AsyncLocalStorageContextManager().enable();

    return {
      value: { tracer: provider.getTracer("my-app"), propagator: new W3CTraceContextPropagator(), context },
      async release() {
        try {
          await provider.shutdown();
        } finally {
          context.disable();
        }
      },
    };
  },
});

// defineApplication({ modules: [applicationModule, observability] })

Or use SDK instances managed elsewhere:

const observability = provideOpenTelemetry({
  requirements: { telemetry },
  factory: ({ telemetry }) => ({ tracer: telemetry.tracer, propagator: telemetry.propagator, context: telemetry.context }),
});

factory and initialize are mutually exclusive. The module provides Flow's trace contract only when its requirements are registered; without it, Flow makes no telemetry calls. Use resourceOrder when the SDK must start before other resources.

API

| Entry | Export | Description | | --- | --- | --- | | root | openTelemetryTracing(options), OpenTelemetryTracingOptions | The Tracing implementation, without Wire. | | /wire | provideOpenTelemetry({ requirements?, factory \| initialize }) | Provides the implementation as a module. |

Options

  • tracer, propagator: required standard API implementations. W3C Trace Context is the usual propagator; B3 and others work too.
  • context: optional active/with/bind implementation; defaults to the global API context.
  • consumerParent: "link" (default) links each delivery's processing span to the message; "parent" continues the producer trace.
  • spanName(span): custom names; messaging spans default to {operation} {destination}.
  • attributes(span): application-selected attributes. Spans carry no actor or credentials.
  • onError(error): diagnostics for instrumentation failures.

What is traced

  • Exposures, listener deliveries, scheduler ticks, commands, queries, guards, Units of Work and their hooks, topic and broadcast admission, and publications.
  • Local spans are INTERNAL, listener processing CONSUMER; producer, server and client keep their kinds. RabbitMQ sends become PRODUCER spans automatically.
  • An active span from native instrumentation, such as an HTTP server span, stays the parent. Scheduler ticks start new traces.
  • Staged publications and after-commit effects keep the context they were staged in; rollback creates no delivery span.
  • Instrumentation failures never change the business result, and work runs once.
  • correlation() returns the active span's traceId and spanId from the same context, so @openknot-ts/logging records join their traces.

Propagation travels as an immutable carrier separate from input and actor; plugs carry only the propagator's propagationFields. Transports add traceAttributes: RabbitMQ adds the messaging system, destination, routing key, operation and message id. RabbitMQ spans follow the messaging and RabbitMQ semantic conventions.

Example and tests

pnpm build
pnpm --filter @openknot-ts/opentelemetry-tracing example

examples/tracing.ts traces an exposure, a listener and a scheduler tick. The tests use real SDK providers with in-memory exporters: W3C propagation through AMQP adapters and a second Node process, links, parent mode, scheduler isolation, sampling, malformed headers and API-only imports.