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

@observability-os/sdk

v0.3.0

Published

**Zero-dependency TypeScript logger, metrics sampler, and distributed APM tracing SDK** for [ObservabilityOS](https://github.com/Vaibhav-Singh2/ObservabilityOS).

Readme

@observability-os/sdk

Zero-dependency TypeScript logger, metrics sampler, and distributed APM tracing SDK for ObservabilityOS.

Features

  • Zero runtime dependencies — runs universally in Node.js, Next.js, Edge runtime, and modern browsers with zero external npm dependencies.
  • Client-Side PII Redaction (scrubber.ts) — automatically masks passwords, credit cards, JWT tokens, and authorization headers before transmission.
  • Distributed APM Tracing (Tracer & Span) — trace execution trees across microservices with parent-child span hierarchy and latency tracking.
  • System & Latency Metrics Auto-Sampler (MetricsCollector) — periodically captures CPU usage, memory consumption, and tracks execution latency.
  • Batch-and-flush architecture — logs and spans are queued in memory and flushed asynchronously with exponential retry safety.
  • Timer safety — uses .unref() timers so background workers do not block Node.js process exits.

Installation

npm install @observability-os/sdk
# or
yarn add @observability-os/sdk
# or
pnpm add @observability-os/sdk

Quick Start

1. Structured Logging & PII Scrubbing

import { Logger } from "@observability-os/sdk";

const logger = new Logger({
  apiKey: "your-project-api-key",
  endpoint: "https://your-instance.com/api/ingest",
  defaultService: "payment-api",
  defaultEnvironment: "prod",
  enableMetrics: true, // Enables CPU & Memory auto-sampling
  enableTracing: true, // Enables distributed APM tracing
});

// Logs are scrubbed for PII locally and flushed in batches
logger.info("Payment processed successfully", {
  metadata: {
    userId: "usr_9921",
    amount: 199.99,
    password: "WillBeMaskedAutomatically",
  },
});

2. Distributed APM Tracing

// Trace async operations with automatic error status tracking
const charge = await logger.withSpan("stripe-charge", async (span) => {
  span.setAttribute("customer.id", "cus_8812");
  span.addEvent("validating_card", { attempt: 1 });

  return await stripe.charges.create({ ... });
});

3. Measuring Latency

const queryResult = await logger.trackLatency(async () => {
  return await db.query("SELECT * FROM users WHERE active = true");
});

API Reference

LoggerConfig

| Option | Type | Default | Description | | -------------------- | ------------------------------ | ---------------------------------- | --------------------------------------------- | | apiKey | string | — | Project Ingestion API Key | | endpoint | string | http://localhost:3000/api/ingest | Base ingestion endpoint | | metricsEndpoint | string | /api/metrics/ingest | Metrics ingestion endpoint | | tracesEndpoint | string | /api/traces/ingest | Traces ingestion endpoint | | defaultService | string | — | Default service name | | defaultEnvironment | "prod" \| "staging" \| "dev" | "dev" | Default deployment environment | | batchSize | number | 20 | Items queued before automatic flush | | flushIntervalMs | number | 1000 | Milliseconds between background flushes | | enableMetrics | boolean | false | Enable periodic CPU & memory metrics sampling | | enableTracing | boolean | false | Enable distributed trace span tracking |

Logger Methods

| Method | Description | | ----------------------------------------- | ----------------------------------------------------------- | | log(level, message, options?) | Log with custom options and local PII scrubbing | | info / warn / error / debug(msg, opts?) | Convenience log level methods | | startSpan(name, options?) | Start a new distributed trace span | | withSpan(name, fn, options?) | Execute an async function wrapped in a trace span | | trackLatency(fn) | Execute a function and record execution duration | | flush() | Immediately flush all queued logs, metrics, and trace spans | | destroy() | Clean up all timers and background workers |

License

MIT © ObservabilityOS