opentelemetry-js

Instruments JavaScript/TypeScript apps with OpenTelemetry for traces and metrics.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/cedricziel/claude-otel-plugin --skill opentelemetry-js
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opentelemetry-js
Source: https://github.com/cedricziel/claude-otel-plugin/tree/main/.claude/skills/opentelemetry-js
Command: npx skills add https://github.com/cedricziel/claude-otel-plugin --skill opentelemetry-js

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

OpenTelemetry JavaScript instrumentation helps developers add observability to JavaScript/TypeScript apps by enabling traces, metrics, and logs across Node.js and browser environments.

Core Features & Use Cases

  • Automatic and manual instrumentation for Node.js and browser apps (Express, React, Next.js, GraphQL, etc.)
  • Guidance on configuring providers, resources, exporters, and instrumentations with practical examples.
  • Use case: Instrument a microservice to emit traces and metrics to OTLP.

Quick Start

  • Install core libraries: npm install @opentelemetry/sdk-node @opentelemetry/auto-instrumentations-node @opentelemetry/exporter-trace-otlp-http
  • Create a tracing setup file (e.g., tracing.js) that initializes NodeSDK with resource attributes, exporters, and instrumentations like getNodeAutoInstrumentations.
  • Run the app and verify traces in your OTLP collector.
  • AI Prompt (example): Explain how to instrument a Node.js Express service with OpenTelemetry including a minimal code sample.

Frequently Asked Questions about opentelemetry-js

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add observability to a Node.js Express application with OpenTelemetry?

Instrument a Node.js Express service by installing @opentelemetry/sdk-node and @opentelemetry/auto-instrumentations-node, creating a tracing.js file that initializes NodeSDK with resource attributes and exporters, then importing it before your app starts. This enables automatic trace collection for HTTP requests and dependencies.

Can I instrument both backend and frontend JavaScript applications with OpenTelemetry?

Yes, OpenTelemetry supports instrumentation across Node.js backends and browser frontends. Use @opentelemetry/sdk-node for servers and browser SDKs for client-side apps like React and Next.js, enabling end-to-end trace visibility across your full stack.

What frameworks and libraries does OpenTelemetry automatically instrument in JavaScript?

OpenTelemetry's auto-instrumentations package automatically covers Express, React, Next.js, GraphQL, and many Node.js libraries. Manual instrumentation is also supported for custom code, giving you control over which components emit traces and metrics.

Do I need to configure exporters separately to send traces from OpenTelemetry?

Yes, you must configure exporters like @opentelemetry/exporter-trace-otlp-http to send traces to a collector. The setup involves specifying your collector's endpoint in the NodeSDK configuration so traces are pushed to your observability backend.

How do I set up resource attributes and context propagation in OpenTelemetry JavaScript?

Define resource attributes (service name, version, environment) when initializing the SDK, and configure context propagation to pass trace IDs across service boundaries. This ensures distributed traces correlate correctly across your microservices.

What's the difference between automatic and manual instrumentation in OpenTelemetry?

Automatic instrumentation uses pre-built modules to capture traces from common libraries without code changes. Manual instrumentation lets you create custom spans and metrics for application-specific logic, often used alongside automatic instrumentation for complete observability.