Requirements
Env Variables
Initialize Logger
Initialize MaximAnthropicClient
Make LLM Calls Using MaximAnthropicClient
Maxim-specific Headers
The Anthropic instrumentation supports additional headers via theextra_headers parameter to enhance trace metadata and organization. You can use the following headers:
x-maxim-trace-id: Associate LLM calls with a specific trace ID (UUID string). All calls with the same trace ID will be grouped together in a single trace.x-maxim-trace-tags: Add custom tags to traces as a JSON string containing key-value pairs. Useful for filtering and organizing traces.x-maxim-generation-name: Assign a custom name to a specific generation/LLM call within a trace (string).x-maxim-session-id: Associate traces with a specific session ID (string).
Example: Using Extra Headers
Advanced Use Case: Streaming Support
Initialize Maxim SDK and Anthropic Client
Make Streaming Calls
Capture Multiple LLM Calls in One Trace
Initialize Maxim SDK and Anthropic Clientx-maxim-trace-id: trace_id will add it to the declared trace.
Capture Multi-Turn Conversations
Initialize Maxim SDK and Anthropic Clientsession_id:
