Use current official OpenInference documentation to select packages and initialization for the detected AI SDK or framework.
- Prefer a framework-native integration when it captures model, chain, and tool activity.
- Otherwise select the provider-specific
@arizeai/openinference-*instrumentor matching imports actually used by the server. - Do not add both framework and provider instrumentation when that would duplicate spans.
- If no auto-instrumentor exists, retain normal OpenTelemetry tracing and add OpenInference semantic attributes to manual spans.
Common JavaScript surfaces include OpenAI, Anthropic, LangChain, Bedrock, Vercel AI SDK, MCP, and GenAI semantic-convention adapters. Verify the current package name and version before installation rather than guessing from this list.
Set up the Firebase exporter and tracer provider, register instrumentations, and only then import or construct AI clients. Respect any framework-specific preload or bootstrap mechanism.
If the application already has a global provider, add the AgentPond exporter to it. Do not replace existing exporters unless the user explicitly asks.
Use manual spans for custom application steps that auto-instrumentation cannot see:
CHAIN: orchestration or agent-loop boundariesTOOL: each tool invocation, including input, output, and error statusAGENT: a meaningful agent execution boundary when the framework does not emit one
Set openinference.span.kind and the applicable input.value, output.value, and MIME-type attributes. Avoid recording secrets or unnecessary personal data.
Set session.id on the outer CHAIN or AGENT span. Generate it once at the conversation boundary and reuse it for every turn in that conversation. Auto-instrumented model and tool spans should be children of that outer span.
- Long-running servers: keep the provider alive and flush at supported lifecycle boundaries.
- Short-lived scripts and test commands: force-flush and shut down before process exit.
- Firebase request handlers: do not shut down a module-level provider after every request.
Run a real application request and verify the resulting trace rather than treating compilation alone as success. Confirm span kinds, inputs/outputs, parent-child relationships, tool results, and session grouping.