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

@absolutejs/telemetry

v0.1.1

Published

Tiny shared OpenTelemetry substrate for the AbsoluteJS ecosystem. Type-replicates @opentelemetry/api's Tracer/Span shape, ships noop implementations + a tracerOrNoop helper + a zero-dep OTLP-HTTP-JSON span exporter (/otlp-http subpath), and pins ABS_ATTRS

Readme

@absolutejs/telemetry

Tiny shared OpenTelemetry substrate for the AbsoluteJS substrate packages.

Docs: absolutejs.com/documentation/telemetry-overview

What it is. Type-replicated OTel surface + noop implementations + the tracerOrNoop() helper + ABS_ATTRS semantic conventions. ~250 LOC, zero runtime deps.

What it solves. The deep-research audit's G2 gap: substrate packages (runtime / sync / queue / router / secrets / rate-limit / isolated-jsc) need OTel spans for the "one trace from edge → runtime → sync → queue → secret" SRE narrative. Without a shared substrate, every package writes its own peer-dep / noop-fallback boilerplate and picks its own attribute names.

How it's wired. Every substrate package factory takes an optional tracerProvider?: TracerProvider. Internally it calls:

const tracer = tracerOrNoop(options.tracerProvider, '@absolutejs/<pkg>');

and uses tracer.startActiveSpan(name, options, fn) in hot paths. When the user passes their @opentelemetry/api TracerProvider, real spans flow through. When they don't, the noop tracer executes the callback with zero allocations.

Install

bun add @absolutejs/telemetry
# Optional — only if you want real OTel spans:
bun add @opentelemetry/api @opentelemetry/sdk-node

The package has no runtime dependencies. It does not peer-dep @opentelemetry/api — its types are structurally compatible, so a real OTel TracerProvider satisfies the shape this package expects.

Usage

As a substrate-package author

import { tracerOrNoop, ABS_ATTRS, type TracerProvider } from '@absolutejs/telemetry';

export type MyPackageOptions = {
  // existing options...
  tracerProvider?: TracerProvider;
};

export const createMyPackage = (options: MyPackageOptions) => {
  const tracer = tracerOrNoop(options.tracerProvider, '@absolutejs/my-package');

  return {
    doWork: async (input: string) => {
      return tracer.startActiveSpan(
        'my-package.doWork',
        { attributes: { [ABS_ATTRS.tenant]: input } },
        async (span) => {
          try {
            const result = await actuallyDoWork(input);
            return result;
          } catch (error) {
            span.recordException(error);
            throw error;
          } finally {
            span.end();
          }
        }
      );
    },
  };
};

Or use the convenience wrapper withSpan(tracer, name, options, fn) that auto-sets status + recordException + end() for the common case.

As a consumer wiring it all together

import { NodeTracerProvider } from '@opentelemetry/sdk-node';
import { createMyPackage } from '@absolutejs/my-package';

const tracerProvider = new NodeTracerProvider({ /* exporter, sampler, etc */ });
tracerProvider.register();

const pkg = createMyPackage({ tracerProvider });
// Spans now flow through to your configured exporter.

API

tracerOrNoop(provider, name, version?)

Returns provider.getTracer(name, version) if provider is defined; otherwise a noop tracer. The canonical entry point for substrate packages.

withSpan(tracer, name, options, fn) / withSpanSync(...)

Wrap an async (or sync) callback in a span that auto-sets:

  • status: OK on success
  • status: ERROR + recordException(error) on throw
  • span.end() in either case (finally)
const result = await withSpan(
  tracer,
  'sync.runMutation',
  { attributes: { [ABS_ATTRS.mutation]: 'createIssue' } },
  async (span) => {
    span.setAttribute(ABS_ATTRS.mutationAttempt, 1);
    return await engine.runMutation('createIssue', args, ctx);
  }
);

createNoopSpan() / createNoopTracer() / createNoopTracerProvider()

Singletons. Useful in tests + as default fallbacks.

ABS_ATTRS

Standard attribute names. Use these instead of inline string literals so cross-package queries (abs.tenant = "acme") resolve in one filter:

abs.tenant                  // tenant / shard key
abs.shard.id

// sync
abs.engine.id
abs.collection
abs.mutation
abs.mutation.attempt
abs.subscription.id
abs.batch.size
abs.cluster.origin

// queue
abs.job.id
abs.job.kind
abs.job.attempt
abs.job.max_attempts
abs.worker.id

// runtime
abs.runtime.key
abs.runtime.pid
abs.runtime.port
abs.runtime.exit_reason
abs.runtime.readiness_ms

// router
abs.route.shard
abs.route.decision

// secrets
abs.secret.name
abs.secret.fingerprint

// audit
abs.audit.kind

Adding NEW attributes is a minor bump; renaming an existing one is a breaking change (anyone querying their span store has hard-coded the old name).

Type re-exports

Tracer, Span, TracerProvider, SpanContext, SpanStatus, SpanStatusCode, SpanKind, SpanOptions, Attributes, AttributeValue, AbsAttrName. Mirror @opentelemetry/api exactly; a real OTel TracerProvider satisfies these types structurally.

License

Apache 2.0. Tier B substrate-adjacent under the AbsoluteJS licensing policy.