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

@matkirit/claude-agent-telemetry

v1.0.0

Published

Drop-in OpenTelemetry instrumentation for Claude Agent SDK

Readme

Claude Agent Telemetry

Drop-in OpenTelemetry instrumentation for Claude Agent SDK. Add full observability (logs, traces, metrics) with one line of code.

Quick Start

import { withTelemetry } from "@matkirit/claude-agent-telemetry";
import { query } from "@anthropic-ai/claude-agent-sdk";

// Just wrap your query - that's it
for await (const msg of withTelemetry(query({ prompt }))) {
  handleMessage(msg);
}

Configuration

Set the required environment variable:

export OTEL_EXPORTER_OTLP_ENDPOINT="http://your-collector:4318"

All configuration is via environment variables:

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | OTEL_EXPORTER_OTLP_ENDPOINT | Yes | - | Your OTLP collector endpoint | | OTEL_SERVICE_NAME | No | claude-agent | Service name in telemetry | | OTEL_SERVICE_VERSION | No | 1.0.0 | Service version | | OTEL_TRACES_SAMPLER_ARG | No | 1.0 | Trace sample rate (0.0-1.0) | | TELEMETRY_ENABLED | No | true | Master switch for all telemetry |

What You Get

  • Traces: Session → Turn → LLM Request / Tool spans
  • Logs: Session lifecycle, tool calls, LLM responses, errors
  • Metrics: Token usage, costs, durations, error counts

Installation

npm install @matkirit/claude-agent-telemetry

Kubernetes Deployment

env:
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: "http://otel-collector.monitoring:4318"
  - name: OTEL_SERVICE_NAME
    value: "my-agent"
  - name: OTEL_TRACES_SAMPLER_ARG
    value: "0.1"  # 10% sampling in production

Graceful Shutdown

import { registerShutdownHandlers } from "@matkirit/claude-agent-telemetry";

registerShutdownHandlers();  // Call once at startup

Metrics

| Metric | Type | Description | |--------|------|-------------| | agent.sessions | Counter | Total sessions | | agent.tool_calls | Counter | Tool invocations by name | | agent.tokens | Counter | Tokens by type (input/output) | | agent.cost_microdollars | Counter | Cost tracking | | agent.session.duration_ms | Histogram | Session duration | | agent.tool.duration_ms | Histogram | Tool execution time |