Skip to main content

Documentation Index

Fetch the complete documentation index at: https://handbook.fiddler.ai/llms.txt

Use this file to discover all available pages before exploring further.

Centralized instrumentation hook for Strands agents with Fiddler integration. This hook provider automatically captures telemetry data from Strands agents and enriches OpenTelemetry spans with Fiddler-specific attributes. It handles three key events: before invocation, after tool execution, and after model calls. The hook is automatically injected when using StrandsAgentInstrumentor, so users typically don’t need to manually add it to their agents.

Example

from strands import Agent
from fiddler_strandsagents import FiddlerInstrumentationHook

# Manual usage (not needed with StrandsAgentInstrumentor)
agent = Agent(
    model=model,
    system_prompt="...",
    hooks=[FiddlerInstrumentationHook()]
)

register_hooks()

Register hook callbacks with the Strands agent registry. This method is called by the Strands framework to register callbacks for various agent lifecycle events.

Parameters

ParameterTypeRequiredDefaultDescription
registryHookRegistryNoneThe HookRegistry to register callbacks with

tool_end()

Handle the completion of a tool invocation. Enriches the current OpenTelemetry span with custom attributes that were set on the tool using set_span_attributes(). Attributes are prefixed with ‘fiddler.span.user.’ for namespacing.

Parameters

ParameterTypeRequiredDefaultDescription
eventAfterToolCallEventNoneAfterToolInvocationEvent containing tool execution details

model_end()

Handle the completion of a model invocation. Enriches the current OpenTelemetry span with custom attributes that were set on the model using set_span_attributes(). Attributes are prefixed with ‘fiddler.span.user.’ for namespacing.

Parameters

ParameterTypeRequiredDefaultDescription
eventAfterModelCallEventNoneAfterModelInvocationEvent containing model execution details

before_invocation()

Handle the start of an agent invocation. Enriches the current OpenTelemetry span with conversation ID and session attributes that were set using set_conversation_id() and set_session_attributes(). This ensures trace-level context is available for all child spans.

Parameters

ParameterTypeRequiredDefaultDescription
eventBeforeInvocationEventNoneBeforeInvocationEvent containing agent invocation details