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

@arlopass/telemetry

v0.1.0

Published

Metrics, tracing helpers, and redaction utilities for Arlopass

Readme

@arlopass/telemetry

Collect metrics, propagate traces, and redact sensitive data across all Arlopass components. Zero dependencies.

import { TelemetryMetrics, TelemetryTracing } from "@arlopass/telemetry";

const metrics = new TelemetryMetrics();
const counter = metrics.createCounter("arlopass.request.total", { correlationId: "req-1", origin: "https://app.acme.com", providerId: "ollama" });
counter.add();

const tracing = new TelemetryTracing();
const result = await tracing.withSpan("arlopass.request", { correlationId: "req-1", origin: "https://app.acme.com", providerId: "ollama" }, async (span) => {
  span.addEvent("provider.dispatch", { modelId: "llama3.2" });
  const res = await doWork();
  span.setStatus("ok");
  return res;
});

API Reference

TelemetryMetrics

Collects metric data points.

const metrics = new TelemetryMetrics(options?: TelemetryMetricsOptions);

| Method | Returns | Description | |--------|---------|-------------| | emit(input: EmitMetricInput) | MetricPoint | Emit a single metric point | | createCounter(name, metadata) | { add(value?: number): MetricPoint } | Create a counter instrument | | createHistogram(name, metadata) | { record(value: number): MetricPoint } | Create a histogram instrument | | getRecordedMetrics() | readonly MetricPoint[] | Retrieve all emitted metrics | | reset() | void | Clear recorded metrics |

type MetricPoint = {
  name: TelemetryMetricName;
  value: number;
  unit: TelemetryMetricUnit;
  timestamp: string;
  metadata: MetricSignalMetadata;
}

Metric Names (TELEMETRY_METRIC_NAMES)

| Name | Unit | |------|------| | arlopass.request.total | count | | arlopass.request.duration_ms | milliseconds | | arlopass.request.failure.total | count | | arlopass.stream.chunk.total | count | | arlopass.stream.interruption.total | count | | arlopass.retry.total | count | | arlopass.adapter.health | ratio |


TelemetryTracing

Trace spans across trust boundaries.

const tracing = new TelemetryTracing(options?: TelemetryTracingOptions);

| Method | Returns | Description | |--------|---------|-------------| | startSpan(name, options) | TelemetrySpan | Start a new span | | withSpan(name, options, callback) | Promise<T> | Execute callback within a span (auto-ends on completion) | | getRecordedSpans() | readonly SpanRecord[] | Retrieve all recorded spans | | reset() | void | Clear recorded spans |

TelemetrySpan

Single trace span with events and status.

| Property/Method | Type | Description | |----------------|------|-------------| | traceId | string | Trace ID | | spanId | string | Span ID | | addEvent(name, attributes?) | void | Add a timestamped event to the span | | setStatus(status) | void | Set span status: "ok" or "error" | | end(attributes?) | SpanRecord | End the span and return the record |

type SpanRecord = {
  traceId: string;
  spanId: string;
  parentSpanId?: string;
  name: TelemetrySpanName;
  startedAt: string;
  endedAt: string;
  status: "ok" | "error";
  metadata: TraceSignalMetadata;
  attributes: TraceAttributes;
  events: readonly SpanEvent[];
}

type SpanEvent = { name: string; timestamp: string; attributes: TraceAttributes }

Span Names (TELEMETRY_SPAN_NAMES)

arlopass.request | arlopass.policy.decision | arlopass.provider.dispatch | arlopass.stream | arlopass.adapter.health


Redaction

Strip sensitive data from logs and telemetry signals.

| Function | Description | |----------|-------------| | redactTelemetryValue(value: unknown, options?: TelemetryRedactionOptions): unknown | Redact a single value | | redactTelemetryRecord(record: Record<string, unknown>, options?: TelemetryRedactionOptions): Record<string, unknown> | Redact all sensitive fields in a record | | assertRequiredMetadataFields(metadata, requiredFields?) | Throws if required metadata is missing | | normalizeSignalMetadata(metadata?, options?) | Normalize and whitelist metadata fields |

const REDACTED_VALUE = "[REDACTED]";
const REQUIRED_SIGNAL_METADATA_FIELDS = ["correlationId", "origin", "providerId"];
const SAFE_SIGNAL_METADATA_FIELDS = ["correlationId", "origin", "providerId", "modelId", "capability", "reasonCode", "outcome", "requestId", "sessionId", "status", "errorName", "errorType"];

Dependencies

None.