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

@spyko/otel-bootstrap

v0.1.1

Published

Two-line OpenTelemetry + pino bootstrap for Node backends: OTLP traces and JSON logs with trace_id correlation baked in

Downloads

87

Readme

@spyko/otel-bootstrap

Two-line OpenTelemetry + pino bootstrap for Node backends: OTLP traces and JSON logs with trace_id correlation baked in.

Why this exists

This package is part of my personal golden path — an opinionated, pre-decided default stack for solo side projects, where observability is provided by a shared platform (Grafana Alloy → VictoriaMetrics / Loki / Tempo / Grafana). See @spyko/eslint-config for the architecture side of the same method.

Trace ↔ logs correlation only works if every log line carries the current trace_id. That rule is too easy to forget when instrumentation is 40 lines of copy-pasted setup — so it lives in a package, and an app needs exactly two lines.

Usage

npm install @spyko/otel-bootstrap
// main.ts — line 1, before any other import
import '@spyko/otel-bootstrap/register'
// anywhere
import { createLogger } from '@spyko/otel-bootstrap'

const logger = createLogger()
logger.info('ready') // {"level":30,"trace_id":"…","span_id":"…","msg":"ready"}

Or explicitly, to control the service name from code:

import { startTelemetry } from '@spyko/otel-bootstrap'

startTelemetry({ serviceName: 'my-api' })

Behavior

  • Traces: OpenTelemetry Node SDK with auto-instrumentation (HTTP, Express/Nest, Postgres, …), exported over OTLP to OTEL_EXPORTER_OTLP_ENDPOINT. Service identity comes from OTEL_SERVICE_NAME. The noisy fs instrumentation is disabled.
  • Logs: pino JSON to stdout. A mixin injects trace_id/span_id whenever a span is active — deterministic, no module patching involved. LOG_LEVEL sets the level (default info).
  • Local dev: when OTEL_EXPORTER_OTLP_ENDPOINT is unset, telemetry is a no-op and logs pretty-print to the console. No collector required, no error spam.
  • Shutdown: SIGTERM/SIGINT flush the trace buffer before exit.

Environment variables

| Variable | Role | |---|---| | OTEL_EXPORTER_OTLP_ENDPOINT | OTLP collector endpoint; unset = telemetry off | | OTEL_SERVICE_NAME | Service identity in traces and metrics | | LOG_LEVEL | pino level, defaults to info |

License

MIT