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

@respan/instrumentation-google-adk

v0.2.0

Published

Respan instrumentation plugin for Google ADK TypeScript

Readme

@respan/instrumentation-google-adk

Translate the native OpenTelemetry spans emitted by Google ADK TypeScript into Respan workflow, agent, chat, tool, and task records.

Install

npm install @respan/tracing @respan/instrumentation-google-adk @google/adk

Requires Google ADK 1.2.x or 2.x and @respan/tracing 1.3.2 or later. The adapter uses the public span transformer registry introduced in tracing 1.3.2. Initialize the tracing runtime before activating it.

Quickstart

Set RESPAN_API_KEY and GOOGLE_GENAI_API_KEY, then run:

import { RespanTelemetry } from "@respan/tracing";
import { GoogleADKInstrumentor } from "@respan/instrumentation-google-adk";

const telemetry = new RespanTelemetry({ appName: "google-adk-demo" });
await telemetry.initialize();
const instrumentor = new GoogleADKInstrumentor();
instrumentor.activate();

try {
  // ADK creates a module-level tracer. Import it after tracing initializes.
  const { InMemoryRunner, LlmAgent } = await import("@google/adk");
  const runner = new InMemoryRunner({
    appName: "google-adk-demo",
    agent: new LlmAgent({
      name: "weather_agent",
      model: "gemini-2.5-flash",
      instruction: "Answer weather questions concisely.",
    }),
  });
  for await (const event of runner.runEphemeral({
    userId: "demo-user",
    newMessage: {
      role: "user",
      parts: [{ text: "What is the weather in Tokyo?" }],
    },
  })) {
    console.log(event.content?.parts?.map((part) => part.text ?? "").join(""));
  }
  await telemetry.flush();
} finally {
  instrumentor.deactivate();
  await telemetry.shutdown();
}

For new Respan({ instrumentations: [new GoogleADKInstrumentor()] }), the facade activates the adapter after await respan.initialize().

Captured operations

  • Runner invocations become workflow spans.
  • Agent invocations become agent spans.
  • Model calls become chat spans with native model, messages, tool schemas, streaming completions, and reported usage.
  • Tool executions become tool spans. gen_ai.tool.call.id connects each execution with the model call and tool response. ADK's merged-tool bookkeeping span becomes a task so it does not count as another execution.
  • ADK 2.x Workflow invocations become workflow spans. execute_node and retry attempt spans become task spans with node paths and reported execution metadata.

Graph workflow APIs are absent in ADK 1.2.0. Tests for those APIs skip at that minimum. Native tracing fields beginning with gcp.vertex.agent.* and graph translator inputs are removed after normalization. Other instrumentation scopes are not classified from their operation names.

Content and lifecycle controls

const instrumentor = new GoogleADKInstrumentor({ traceContent: false });

The adapter also honors RESPAN_TRACE_CONTENT=false, TRACELOOP_TRACE_CONTENT=false, ADK's ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false, the Traceloop content context, observed span vetoes, and OpenTelemetry suppression. A recorded content veto remains in effect for that invocation. Sampling stays with the active OpenTelemetry provider.

Repeated activation is idempotent; multiple owners share one translation. Deactivation stops admission of new spans while spans already in flight finish translating. Native SDK methods, returned events, and iterator behavior are unchanged.

ADK itself determines which fields exist. For example, it omits inline request bytes from native telemetry and can represent a provider failure as an error event while leaving span status unset. This adapter does not reconstruct withheld data or invent usage, status, or model responses.

See the controlled examples for Gemini transport fixtures that exercise the real SDK without a provider key.