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

@xeonr/telemetry

v0.2.0

Published

Node telemetry for Xeonr services: node --import @xeonr/telemetry/register starts OpenTelemetry (through @lntrn/otel) with OTLP gRPC to the cluster collector, AlwaysOn sampling and a fixed instrumentation list, and adds the fleet's identity vocabulary, in

Readme

@xeonr/telemetry

Telemetry for Xeonr's Node services: the Node mirror of go-platform's telemetry package, and the way a Node service meets Plumb's obs.node-telemetry.

node --import @xeonr/telemetry/register dist/server.js   # ES modules
node --require @xeonr/telemetry/register dist/server.cjs # CommonJS

register starts OpenTelemetry before the app loads. The SDK itself is @lntrn/otel, Lantern's add-on for the stock NodeSDK. This package makes the Xeonr choices on top:

  • OTLP gRPC to the cluster collector, from OTEL_EXPORTER_OTLP_ENDPOINT (Go-style host:port or a URL). In-cluster hosts and OTEL_EXPORTER_OTLP_INSECURE=true are cleartext. With no endpoint nothing is sent: one telemetry export disabled line, and spans still get ids so log lines still carry them.
  • Resource from OTEL_SERVICE_NAME, OTEL_SERVICE_NAMESPACE, OTEL_SERVICE_VERSION, ENV (else NODE_ENV, as prod/dev) as deployment.environment, and the pod name as service.instance.id.
  • AlwaysOn sampling. W3C trace context is the only propagator: baggage is sent only by this package's in-cluster helpers.
  • A fixed instrumentation list, never auto-instrumentations-node: http, undici (fetch), ioredis, mysql2 (statements masked), pg, aws-sdk, runtime-node, and pino (trace ids on lines, never log export). /healthz is not traced. Client spans need a parent: one without becomes nothing rather than a root (xeonr_telemetry_rootless_client_spans_total counts the ones dropped).
  • Runtime metrics: runtime-node's event loop, heap and GC, and host-metrics' process.cpu.* and process.memory.* (the pod, not the node).
  • No log export: logs go to stdout for the Lantern agent. No HTTP RED histograms: spanmetrics derives RED from the spans.
  • Identity on every span, from the request or job it belongs to; URL queries and credentials stripped from URL attributes.

Identity (§4.2)

import { setIdentity, setTeam, setResource } from "@xeonr/telemetry";

// where the service verifies a Xeonr caller itself (its auth interceptor)
setIdentity({ subject: principal.sub, orgId, clientId, authMethod: "bearer", scopes });
// in a handler acting on an owned resource
setTeam(bucket.teamUrn);
setResource("bucket", bucket.id, bucket.urn);

The keys are generated from go-platform's telemetry/keys.json (src/keys.json, copied byte for byte; pnpm gen-keys).

Connect

import { clientInterceptor, peerContextValues, serverInterceptor } from "@xeonr/telemetry/connect";

app.register(fastifyConnectPlugin, {
  routes,
  interceptors: [serverInterceptor(), authInterceptor], // telemetry first
  contextValues: peerContextValues,                     // the TCP peer, for trust
});
const transport = createConnectTransport({ baseUrl, interceptors: [clientInterceptor({ peer: "upl-im-api" })] });

The server continues a caller's traceparent and honours its origin baggage only from a trusted peer (TRUSTED_PROXY_CIDR, default 10.0.0.0/8, as go-platform); anyone else's trace becomes a link. Status follows otelconnect: only a server-class code is an error.

Jobs

import { runJob, startJob, detach } from "@xeonr/telemetry";

await runJob("upl.trace.reconcile", () => reconcile(), { trigger: "cron" });
const job = startJob("upl.parse_upload", { trigger: "queue", links });
// … context.with(job.ctx, …) …
job.end(err);
void runJob("upl.index", () => index(id), { ctx: detach(), trigger: "request" }); // from a handler

A job is a root span with xeonr.job.* and system identity (or the caller's, when started from a request), and counts xeonr_job_runs_total and xeonr_job_duration_seconds.

Outbound HTTP

import { fetchWith, withPeer, baggageFor } from "@xeonr/telemetry";

const discord = fetchWith({ peer: "discord" });          // fetch with peer.service, no baggage
const api = fetchWith({ peer: "upl-im-api" });           // in-cluster: origin baggage too
await withPeer("s3", () => s3.send(cmd));                // any other client

Logging

import { logger, withContext } from "@xeonr/telemetry/log";

logger.info({ upload_id }, "parsed");

pino, JSON on stdout as logrus writes it (level, time, msg), with trace_id, span_id, trace_flags, the §4.2 fields, procedure and ip from the active context; credentials redacted by key; errors as {type, message, stack, code} with tokens, emails and URL queries removed. An Error line inside a span is mirrored as a span event.

Shutting down

register flushes when the event loop empties. A service that handles SIGTERM itself calls shutdown() last, after its servers and workers have drained; one that does not gets a flush and the signal re-raised.

Run-time span processors

addSpanProcessor(p) adds a processor after boot (the upl-im pipeline's run-trace store). It sees the spans started after it. A span event made with localEvent(attrs) reaches those processors but is never exported: for payloads a product shows its own users, which must not reach Lantern.

Releasing

Bump "version" and merge to main: CI (.xeonr-ci.yaml, app telemetry) tests, builds and publishes any version the registry hasn't got, and tags it telemetry-vX.Y.Z.