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

@devtheops/opencode-plugin-otel

v0.3.0

Published

An [opencode](https://opencode.ai) plugin that exports telemetry via OpenTelemetry (OTLP/gRPC), mirroring the same signals as [Claude Code's monitoring](https://code.claude.com/docs/en/monitoring-usage).

Readme

opencode-plugin-otel

An opencode plugin that exports telemetry via OpenTelemetry (OTLP/gRPC), mirroring the same signals as Claude Code's monitoring.

What it instruments

Metrics

| Metric | Description | |--------|-------------| | opencode.session.count | Counter — incremented on each session.created event | | opencode.token.usage | Counter — per token type: input, output, reasoning, cacheRead, cacheCreation | | opencode.cost.usage | Counter — USD cost per completed assistant message | | opencode.lines_of_code.count | Counter — lines added/removed per session.diff event | | opencode.commit.count | Counter — git commits detected via bash tool | | opencode.tool.duration | Histogram — tool execution time in milliseconds |

Log events

| Event | Description | |-------|-------------| | session.created | Session started | | session.idle | Session went idle | | session.error | Session error | | user_prompt | User sent a message (includes prompt_length, model, agent) | | api_request | Completed assistant message (tokens, cost, duration) | | api_error | Failed assistant message (error summary, duration) | | tool_result | Tool completed or errored (duration, success, output size) | | tool_decision | Permission prompt answered (accept/reject) | | commit | Git commit detected |

Installation

Add the plugin to your opencode config at ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@devtheops/opencode-plugin-otel"]
}

Or point directly at a local checkout for development:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["/path/to/opencode-plugin-otel/src/index.ts"]
}

Configuration

All configuration is via environment variables. Set them in your shell profile (~/.zshrc, ~/.bashrc, etc.).

| Variable | Default | Description | |----------|---------|-------------| | OPENCODE_ENABLE_TELEMETRY | (unset) | Set to any non-empty value to enable the plugin | | OPENCODE_OTLP_ENDPOINT | http://localhost:4317 | gRPC OTLP collector endpoint | | OPENCODE_OTLP_METRICS_INTERVAL | 60000 | Metrics export interval in milliseconds | | OPENCODE_OTLP_LOGS_INTERVAL | 5000 | Logs export interval in milliseconds | | OPENCODE_METRIC_PREFIX | opencode. | Prefix for all metric names (e.g. set to claude_code. for Claude Code dashboard compatibility) | | OPENCODE_OTLP_HEADERS | (unset) | Comma-separated key=value headers added to all OTLP exports. Example: api-key=abc123,x-tenant=my-org. Keep out of version control — may contain sensitive auth tokens. | | OPENCODE_RESOURCE_ATTRIBUTES | (unset) | Comma-separated key=value pairs merged into the OTel resource. Example: service.version=1.2.3,deployment.environment=production |

Headers and resource attributes

# Auth token for a managed collector (e.g. Honeycomb, Grafana Cloud)
export OPENCODE_OTLP_HEADERS="x-honeycomb-team=your-api-key,x-honeycomb-dataset=opencode"

# Tag every metric and log with deployment context
export OPENCODE_RESOURCE_ATTRIBUTES="service.version=1.2.3,deployment.environment=production"

Security note: OPENCODE_OTLP_HEADERS typically contains auth tokens. Set it in your shell profile (~/.zshrc, ~/.bashrc) or a secrets manager — never commit it to version control or print it in CI logs.

Quick start

export OPENCODE_ENABLE_TELEMETRY=1
export OPENCODE_OTLP_ENDPOINT=http://localhost:4317
opencode

Datadog example

export OPENCODE_ENABLE_TELEMETRY=1
export OPENCODE_OTLP_ENDPOINT=https://api.datadoghq.com

Honeycomb example

export OPENCODE_ENABLE_TELEMETRY=1
export OPENCODE_OTLP_ENDPOINT=https://api.honeycomb.io

Claude Code dashboard compatibility

export OPENCODE_METRIC_PREFIX=claude_code.

Local development

See CONTRIBUTING.md.