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

@yaebal/otel

v0.0.5

Published

yaebal otel — opentelemetry tracing: a span per update, a child span per bot api call, custom spans via ctx.otel.

Readme

@yaebal/otel

opentelemetry tracing for yaebal bots. every update becomes a CONSUMER span and every bot api call made while handling it a CLIENT child span — retries show up as one span per attempt — so a slow handler, a flood wait or a failing method is one trace away in jaeger, grafana tempo, honeycomb, axiom or any other otel backend. depends on @opentelemetry/api only: bring your own sdk and exporter.

install

pnpm add @yaebal/otel @opentelemetry/api

usage

register an sdk (it installs the async context manager that links child spans to their update), then install otel() first, so the update span wraps every other plugin:

import { NodeSDK } from "@opentelemetry/sdk-node";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
import { Bot } from "@yaebal/core";
import { otel } from "@yaebal/otel";

new NodeSDK({ serviceName: "my-bot", traceExporter: new OTLPTraceExporter() }).start();

const bot = new Bot(process.env.BOT_TOKEN!).install(otel());

bot.command("report", async (ctx) => {
	const rows = await ctx.otel.record("db.query", () => db.report()); // a child span
	ctx.otel.setAttributes({ "report.rows": rows.length });
	await ctx.send(render(rows));
});

a trace for one update looks like this:

telegram.update/message          CONSUMER  update_id, update_type, chat.id, chat.type, user.id
├── db.query                     INTERNAL  (ctx.otel.record)
└── telegram.api/sendMessage     CLIENT    method, chat.id, error_code on failure

what lands on ctx

| field | does | | --- | --- | | ctx.otel.span | the update's span | | ctx.otel.record(name, fn) | runs fn in a child span — ended for you, marked failed if it throws | | ctx.otel.setAttributes(attrs) | adds attributes to the update span |

options

| option | default | does | | --- | --- | --- | | tracer | trace.getTracer("@yaebal/otel") | the tracer to record with | | recordApiParams | false | attach each call's params as telegram.params (json, uploads named, cut at 4096 chars) — off by default because params carry user text | | attributes | — | (ctx) => Attributes added to every update span |

behavior

  • a handler that throws marks the update span ERROR with the exception recorded, then rethrows to bot.onError as usual. a failed api call does the same on its own span, plus telegram.error_code.
  • the bot token never reaches a span — only method names and (opt-in) params.
  • instrumentApi(api, options) traces a bare createApi client without a bot.
  • without an async context manager (no sdk registered) api spans still record, as roots.

part of yaebal — a type-safe, runtime-agnostic Telegram Bot API framework. MIT.