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

@orgn/otel-helpers

v0.1.1

Published

Tiny TypeScript helpers for native OpenTelemetry spans and GenAI semantic conventions. Orgn Observe distribution of superloglabs/otel-helpers.

Readme

@orgn/otel-helpers

npm License: MIT Node >=18

Tiny TypeScript helpers for native OpenTelemetry, used by Orgn Observe.

  • Add spans with minimal diff impact
  • Record LLM costs

This is the Orgn Observe distribution of the open-source @superlog/otel-helpers (MIT). Same API, published under the @orgn scope so Orgn Observe onboarding skills can import { withSpan } from "@orgn/otel-helpers".

npm i @orgn/otel-helpers @opentelemetry/api

withSpan

withSpan allows you to create a span around a function in a way that is easy to review. Here is the same handleCheckout instrumented two ways.

Original:

async function handleCheckout(orderId: string) {
  const order = await loadOrder(orderId);
  await chargeCard(order);
  return order;
}

Vanilla OpenTelemetry SDK:

--- original.ts
+++ manual.ts
@@ -1,5 +1,20 @@
+import { trace, SpanStatusCode } from "@opentelemetry/api";
+
+const tracer = trace.getTracer("checkout");
+
 async function handleCheckout(orderId: string) {
-  const order = await loadOrder(orderId);
-  await chargeCard(order);
-  return order;
+  return tracer.startActiveSpan("api.checkout", async (span) => {
+    try {
+      span.setAttribute("order.id", orderId);
+      const order = await loadOrder(orderId);
+      await chargeCard(order);
+      return order;
+    } catch (err) {
+      span.recordException(err as Error);
+      span.setStatus({ code: SpanStatusCode.ERROR });
+      throw err;
+    } finally {
+      span.end();
+    }
+  });
 }

Notice that:

  • The entire function is indented, creating a long diff hunk.
    • The reviewer needs to visually compare versions to analyze changes.
  • The try/catch block creates code changes around the key logic of the function.

Here's the diff produced by withSpan:

--- original.ts
+++ helper.ts
@@ -1,5 +1,9 @@
+import { withSpan } from "@orgn/otel-helpers";
+
 async function handleCheckout(orderId: string) {
-  const order = await loadOrder(orderId);
-  await chargeCard(order);
-  return order;
+  return withSpan("api.checkout", async (span) => {
+    span.setAttribute("order.id", orderId);
+    const order = await loadOrder(orderId);
+    await chargeCard(order);
+    return order;
+  });
 }
  • The diff is now purely additive
  • It is easy to identify the scope of the changes and their potential impact.

GenAI spans

  • Creates spans and metrics for LLM calls
  • Respects OTel Semantic conventions
import { withGenAiSpan, recordGenAiUsage, anthropicUsage } from "@orgn/otel-helpers";

const response = await withGenAiSpan(
  {
    operation: "chat",
    provider: "anthropic",
    requestModel: MODEL,
    useCase: "stylist",
    callSite: "initial",
  },
  async (span) => {
    const res = await client.messages.create({
      model: MODEL,
      max_tokens: 2048,
      system: SYSTEM_PROMPT,
      tools,
      messages,
    });

    recordGenAiUsage(span, anthropicUsage(res));
    return res;
  },
);

The package emits current OpenTelemetry GenAI semantic convention attributes:

  • gen_ai.operation.name
  • gen_ai.provider.name
  • gen_ai.request.model
  • gen_ai.response.model
  • gen_ai.usage.input_tokens
  • gen_ai.usage.output_tokens
  • gen_ai.response.finish_reasons

The GenAI semantic conventions are currently marked Development by OpenTelemetry. This package follows the current names, and keeps product-specific dimensions under app.gen_ai.*.

License

MIT — see LICENSE. Derived from @superlog/otel-helpers.