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

@emmett-community/emmett-observability

v0.1.1

Published

Application-level observability helpers for Emmett apps (logging + tracing)

Readme

@emmett-community/emmett-observability

Application-level observability helpers for Emmett apps. This package wires OpenTelemetry tracing and Pino logging in a way that is explicit, opt-in, and friendly to application composition.

npm version License: MIT Build and test

Features

  • ✅ Explicit tracing initialization (OTLP or console exporter)
  • ✅ Pino logger factory with trace correlation
  • ✅ Shared conventions for attributes and span naming
  • ✅ No side effects on import

Why this package exists

Applications need consistent observability wiring without pulling in Emmett core packages or hiding OpenTelemetry concepts. This package provides a small, explicit layer that applications can opt into while keeping infrastructure concerns outside domain logic.

How it relates to other emmett-community packages

  • It is only for applications.
  • It is not a dependency of any emmett-* core packages (pubsub, firestore, express, etc).
  • It shares conventions with the rest of the ecosystem but stays decoupled from domain code.

Why it is optional

Observability choices (tracing exporters, sampling, logger configuration) are infrastructure decisions that vary per application. This package keeps those decisions explicit and keeps imports silent by default.

Installation

npm install @emmett-community/emmett-observability

Quick start

import { initTracing, createLogger } from '@emmett-community/emmett-observability';

const shutdown = await initTracing({
  serviceName: 'billing-api',
  serviceVersion: '1.2.0',
  environment: 'production',
  exporter: { type: 'otlp', options: { url: 'http://localhost:4318/v1/traces' } },
  sampling: { ratio: 1 },
});

const logger = createLogger({
  serviceName: 'billing-api',
  environment: 'production',
  logLevel: 'info',
});

logger.info({ event: 'startup' }, 'service-ready');

process.on('SIGTERM', async () => {
  await shutdown();
  process.exit(0);
});

Tracing

import { initTracing } from '@emmett-community/emmett-observability';

const shutdown = await initTracing({
  serviceName: 'payments-api',
  environment: 'staging',
  exporter: { type: 'console' },
  sampling: { ratio: 0.25, parentBased: true },
});

// ...start spans with @opentelemetry/api

await shutdown();

Logging

import { context, trace } from '@opentelemetry/api';
import { createLogger } from '@emmett-community/emmett-observability';

const logger = createLogger({ serviceName: 'orders-api', environment: 'dev' });
const tracer = trace.getTracer('orders');

const span = tracer.startSpan('http.request');
context.with(trace.setSpan(context.active(), span), () => {
  logger.info({ route: '/health' }, 'request');
  span.end();
});

When tracing is active, log entries include trace_id and span_id fields.

Pretty logs (development)

By default, logging outputs JSON. To enable pretty logs locally, set LOG_PRETTY=true. If LOG_PRETTY is not set, pretty logs are enabled when NODE_ENV is development or test. Production output remains JSON.

LOG_PRETTY=true node ./dist/index.js

Conventions

import { createSpanName, LogAttributes } from '@emmett-community/emmett-observability';

const spanName = createSpanName({
  component: 'http',
  operation: 'request',
  target: 'GET /health',
});

// LogAttributes.traceId => "trace_id"
// LogAttributes.spanId => "span_id"

Auto-instrumentation

This package does not auto-register instrumentations. If you want auto-instrumentation, register it explicitly in your application after initializing tracing:

import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import { initTracing } from '@emmett-community/emmett-observability';

await initTracing({
  serviceName: 'orders-api',
  exporter: { type: 'otlp' },
});

registerInstrumentations({
  instrumentations: [getNodeAutoInstrumentations()],
});

What this package intentionally does NOT do

  • Initialize tracing or logging on import
  • Create spans for you automatically
  • Depend on any emmett-* core package
  • Depend on Google Cloud SDKs
  • Include domain logic or business rules
  • Hide OpenTelemetry concepts behind abstractions

Testing

npm run test:unit
npm run test:int
npm run test:e2e

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

Made with ❤️ by the Emmett Community