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

@rdcp.dev/otel-plugin

v1.1.0

Published

OpenTelemetry integration plugin for RDCP SDK - Enterprise-grade trace correlation

Readme

@rdcp.dev/otel-plugin

OpenTelemetry integration plugin for RDCP SDK - Enterprise-grade trace correlation

npm version License: Apache-2.0

🎯 Overview

The @rdcp.dev/otel-plugin provides seamless integration between the RDCP SDK and OpenTelemetry, enabling automatic trace correlation in debug logs. This enterprise-grade plugin allows you to correlate debug output with distributed traces across your entire system.

Key Benefits

  • 📊 Automatic Trace Correlation: Debug logs automatically include trace IDs and span IDs
  • 🔧 Zero Configuration: Works out-of-the-box with existing OpenTelemetry setup
  • 🚀 Performance Optimized: Zero impact when OpenTelemetry is not available
  • 🏢 Enterprise Ready: Production-grade error handling and fallbacks
  • 📦 Optional Dependency: Core RDCP SDK works independently

🚀 Quick Start

Installation

npm install @rdcp.dev/otel-plugin @opentelemetry/api

Basic Usage

import { debug, enableDebugCategories } from '@rdcp.dev/server'
import { setupRDCPWithOpenTelemetry } from '@rdcp.dev/otel-plugin'

// Enable OpenTelemetry integration
setupRDCPWithOpenTelemetry()

// Enable debug categories
enableDebugCategories(['DATABASE', 'API_ROUTES'])

// Debug logs now include trace correlation automatically
debug.database('Query executed', { sql: 'SELECT * FROM users' })
// Output: 🔌 [DB] [trace:90abcdef] Query executed [{ sql: 'SELECT * FROM users' }]

debug.api('Request processed', { method: 'GET', path: '/users/123' })
// Output: 🔍 [API] [trace:90abcdef] Request processed [{ method: 'GET', path: '/users/123' }]

📖 Documentation

Setup Functions

setupRDCPWithOpenTelemetry(config?)

Enables OpenTelemetry integration with optional configuration.

import { setupRDCPWithOpenTelemetry } from '@rdcp.dev/otel-plugin'

// Basic setup
setupRDCPWithOpenTelemetry()

// With configuration
setupRDCPWithOpenTelemetry({
  enableTraceCorrelation: true,
  enableBaggage: true
})

Configuration Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | enableTraceCorrelation | boolean | true | Enable automatic trace correlation | | enableBaggage | boolean | true | Extract baggage from OpenTelemetry context | | customProvider | TraceProvider | undefined | Use custom trace provider implementation |

disableRDCPOpenTelemetry()

Disables OpenTelemetry integration.

import { disableRDCPOpenTelemetry } from '@rdcp.dev/otel-plugin'

disableRDCPOpenTelemetry()

isRDCPOpenTelemetryActive()

Checks if OpenTelemetry integration is currently active.

import { isRDCPOpenTelemetryActive } from '@rdcp.dev/otel-plugin'

if (isRDCPOpenTelemetryActive()) {
  console.log('OpenTelemetry integration is active')
}

Advanced Usage

Custom Provider

For advanced use cases, you can create your own trace provider:

import { createOpenTelemetryProvider, setupRDCPWithOpenTelemetry } from '@rdcp.dev/otel-plugin'
import type { TraceProvider } from '@rdcp.dev/otel-plugin'

// Create provider instance
const provider = createOpenTelemetryProvider()

// Custom setup logic...
if (provider.isConfigured()) {
  setupRDCPWithOpenTelemetry({ customProvider: provider })
}

Integration with Popular OpenTelemetry Setups

With @opentelemetry/sdk-node:

import { NodeSDK } from '@opentelemetry/sdk-node'
import { setupRDCPWithOpenTelemetry } from '@rdcp.dev/otel-plugin'

// Initialize OpenTelemetry first
const sdk = new NodeSDK({
  // your OpenTelemetry configuration
})
sdk.start()

// Then enable RDCP integration
setupRDCPWithOpenTelemetry()

With Custom Tracer Provider:

import { trace } from '@opentelemetry/api'
import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base'
import { setupRDCPWithOpenTelemetry } from '@rdcp.dev/otel-plugin'

// Initialize OpenTelemetry
const provider = new BasicTracerProvider()
trace.setGlobalTracerProvider(provider)

// Enable RDCP integration
setupRDCPWithOpenTelemetry()

🏗️ Architecture

This plugin implements the TraceProvider interface from @rdcp.dev/server, providing a clean abstraction between RDCP and OpenTelemetry:

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────────┐
│   Your App     │    │   @rdcp.dev/server   │    │ @rdcp.dev/otel-plugin   │
│                │    │                  │    │                     │
│ debug.api(...)─┼────►│ TraceProvider ───┼────►│ OpenTelemetryProvider│
│                │    │ Interface        │    │                     │
└─────────────────┘    └──────────────────┘    └─────────────────────┘
                                                            │
                                                            ▼
                                                ┌─────────────────────┐
                                                │ OpenTelemetry API   │
                                                │ trace.getActiveSpan │
                                                └─────────────────────┘

🧪 Testing

# Run tests
npm test

# Run with coverage
npm run test:coverage

# Watch mode
npm run test:watch

🔧 Development

# Install dependencies
npm install

# Build
npm run build

# Type check
npm run type-check

# Lint
npm run lint

📦 Compatibility

  • Node.js: >= 16.0.0
  • OpenTelemetry API: >= 1.0.0 < 2.0.0
  • RDCP Server: ^1.0.0

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details.

📄 License

MIT - see LICENSE for details.

🔗 Related Packages