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

@camino-tec/otel-sdk

v1.6.0

Published

SDK genérico de observabilidade OpenTelemetry para aplicações Node.js

Readme

@camino-tec/otel-sdk

SDK genérico de observabilidade OpenTelemetry para aplicações Node.js.
Configura traces (OTLP HTTP), métricas (OTLP gRPC) e logs (bridge pino → OTEL Logs API) com uma única chamada.

Instalação

npm install @camino-tec/otel-sdk
# ou
yarn add @camino-tec/otel-sdk

Uso básico

import { initializeObservability } from '@camino-tec/otel-sdk';

const sdk = initializeObservability({
  serviceName: 'meu-servico',
  serviceVersion: '1.0.0',
});

Logs: bridge pino → OpenTelemetry

A função createOtelLogStream() retorna um Writable stream do Node.js que recebe linhas JSON do pino e emite LogRecord via OpenTelemetry Logs API — sem precisar de loader hooks ou monkey-patching. Funciona em ESM e CJS.

Setup básico com pino

import pino from 'pino';
import { initializeObservability, createOtelLogStream } from '@camino-tec/otel-sdk';

const sdk = initializeObservability({ serviceName: 'meu-app' });
const log = pino({ level: 'debug' }, createOtelLogStream());

log.info('Aplicação iniciada');
log.error({ userId: 42 }, 'Falha ao processar requisição');

Setup com pino.multistream (pino-pretty + OTEL)

import pino from 'pino';
import { initializeObservability, createOtelLogStream } from '@camino-tec/otel-sdk';

const sdk = initializeObservability({ serviceName: 'meu-app' });

const log = pino(
  { level: 'debug' },
  pino.multistream([
    {
      level: 'info',
      stream: pino.transport({
        target: 'pino-pretty',
        options: { colorize: true },
      }),
    },
    { level: 'debug', stream: createOtelLogStream() },
  ]),
);

log.info('Visível no terminal E enviado ao collector');
log.debug({ requestId: 'abc-123' }, 'Só vai pro collector');

Shutdown (obrigatório para CLIs/scripts)

Para scripts ou CLIs que terminam, é necessário chamar sdk.shutdown() para garantir que todos os logs/traces/métricas pendentes sejam exportados antes do processo encerrar:

async function main() {
  const sdk = initializeObservability({ serviceName: 'meu-cli' });
  const log = pino({ level: 'info' }, createOtelLogStream());

  log.info('Processando...');
  // ... lógica do script ...

  await sdk.shutdown();
}

main();

Em servidores HTTP de longa duração, o flush acontece periodicamente e o shutdown() deve ser chamado no handler de SIGTERM/SIGINT.

Variáveis de ambiente

| Variável | Descrição | |---|---| | SERVICE_NAME | Nome do serviço (pode ser passado via serviceName nas options) | | SERVICE_VERSION | Versão do serviço (default: 1.0.0) | | OTEL_EXPORTER_OTLP_ENDPOINT | Endpoint base OTLP | | OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | Endpoint específico para traces | | OTEL_EXPORTER_OTLP_METRICS_ENDPOINT | Endpoint específico para métricas |

Licença

UNLICENSED