@respan/instrumentation-google-adk
v0.1.0
Published
Respan instrumentation plugin for Google ADK TypeScript
Readme
@respan/instrumentation-google-adk
Respan instrumentation plugin for Google ADK TypeScript.
The Google ADK JavaScript SDK already emits OpenTelemetry spans from its
gcp.vertex.agent tracer. This package installs a Respan-local translator hook
that normalizes those ADK runner, agent, LLM, and tool spans into canonical
Respan fields before export.
Install
npm install @respan/respan @respan/instrumentation-google-adk @google/adkQuickstart
import { Respan } from "@respan/respan";
import { GoogleADKInstrumentor } from "@respan/instrumentation-google-adk";
const respan = new Respan({
instrumentations: [new GoogleADKInstrumentor()],
});
await respan.initialize();
// Import ADK after Respan initializes so ADK's module-level tracer is created
// from the active OpenTelemetry provider.
const { InMemoryRunner, LlmAgent } = await import("@google/adk");
const agent = new LlmAgent({
name: "weather_agent",
model: "gemini-2.5-flash",
instruction: "Answer weather questions concisely.",
});
const runner = new InMemoryRunner({
appName: "google-adk-demo",
agent,
});
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 respan.flush();Captured Spans
- ADK runner invocations as
workflowspans - Agent invocations as
agentspans - Model calls as
chatspans with prompt, completion, tool definition, and token fields - Tool executions as
toolspans with normalized input and output
ADK-specific gcp.vertex.agent.* attributes are translator-local raw inputs and
are stripped before export.
