Skip to main content

Install

Setup

Anthropic traces can include input messages, output messages, tool names, and tool parameters. Review Data Governance before enabling production traffic.
Tool-use blocks are unpacked. You get llm.input_messages.*, llm.output_messages.*, tool.name, tool.parameters, and llm.token_count.{prompt,completion}.

Alternative

The Traceloop alternative (opentelemetry-instrumentation-anthropic) emits gen_ai.* and traceloop.*: also recognized by Agnost.

Verify

Run one client.messages.create call, then open Raw logs in Agnost. Confirm message and tool-use attributes appear as expected.

Troubleshooting

  • Confirm AnthropicInstrumentor().instrument(...) runs before Anthropic calls.
  • Confirm OTEL_EXPORTER_OTLP_HEADERS contains X-Agnost-Org-ID=<your-org-id>.
  • Confirm using_attributes wraps the call you want grouped.

References