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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@comprehend/telemetry-node

v0.1.4

Published

Integration of comprehend.dev with OpenTelemetry in Node.js and similar environemnts.

Readme

@comprehend/telemetry-node

OpenTelemetry integration for comprehend.dev - automatically capture and analyze your Node.js application's architecture and performance.

Installation

npm install @comprehend/telemetry-node

Quick Start

Starting from scratch

If you don't have OpenTelemetry set up yet, here's a complete setup:

npm install @comprehend/telemetry-node @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node
import { NodeSDK } from '@opentelemetry/sdk-node';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import { Resource } from '@opentelemetry/resources';
import { ComprehendDevSpanProcessor } from '@comprehend/telemetry-node';

// Set up OpenTelemetry with your service information
const sdk = new NodeSDK({
    resource: new Resource({
        'service.name': 'my-node-service',
        'service.namespace': 'production',
        'deployment.environment': 'prod'
    }),
    spanProcessors: [
        new ComprehendDevSpanProcessor({
            organization: 'your-org',  // Use your organization name
            token: process.env.COMPREHEND_INGESTION_TOKEN!,
            debug: true  // Optional: enable debug logging (or pass a custom logger function)
        })
    ],
    instrumentations: [getNodeAutoInstrumentations()],
});

sdk.start();

// Graceful shutdown
process.on('SIGTERM', () => {
    sdk.shutdown().then(() => console.log('Tracing terminated'));
});

Adding to existing OpenTelemetry setup

If you already have OpenTelemetry configured, simply add the ComprehendDevSpanProcessor to your existing span processors:

import { ComprehendDevSpanProcessor } from '@comprehend/telemetry-node';

// Add to your existing span processors array
const comprehendProcessor = new ComprehendDevSpanProcessor({
    organization: 'your-org',
    token: process.env.COMPREHEND_INGESTION_TOKEN!,
    debug: false  // Optional
});

// If using NodeSDK:
const sdk = new NodeSDK({
    // ... your existing config
    spanProcessors: [
        // ... your existing processors
        comprehendProcessor
    ],
});

// Or if using TracerProvider directly:
tracerProvider.addSpanProcessor(comprehendProcessor);

Configuration

Set your comprehend.dev ingestion token as an environment variable:

export COMPREHEND_INGESTION_TOKEN=your-ingestion-token-here

Note: In production environments, the token should be stored in a secure secret management system (such as AWS Secrets Manager, HashiCorp Vault, Azure Key Vault, Kubernetes Secrets, or your cloud provider's secret management service) and injected into the environment through your container orchestrator's workload definition or service configuration.

What it captures

This integration automatically captures:

  • HTTP Routes - API endpoints and their usage patterns
  • Database Operations - SQL queries with table operations analysis
  • Service Dependencies - HTTP client calls to external services
  • Performance Metrics - Request durations, response codes, error rates
  • Service Architecture - Automatically maps your service relationships

Requirements

  • Node.js 14+
  • OpenTelemetry SDK (peer dependency)

Framework Support

Works with any Node.js framework that supports OpenTelemetry auto-instrumentation:

  • Express
  • Fastify
  • Koa
  • NestJS
  • PostgreSQL
  • MySQL
  • MongoDB
  • Prisma
  • Sequelize
  • TypeORM
  • And more...

Learn More

Development

See DEVELOPMENT.md for development setup and release instructions.