Metadata-Version: 2.4
Name: fiddler-adk
Version: 1.0.1
Summary: Fiddler SDK for Google ADK (Agent Development Kit) instrumentation with OpenTelemetry
Author-email: Fiddler AI <support@fiddler.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://fiddler.ai
Project-URL: Documentation, https://docs.fiddler.ai
Project-URL: Repository, https://github.com/fiddler-labs/fiddler-sdk
Project-URL: Issues, https://github.com/fiddler-labs/fiddler-sdk/issues
Keywords: fiddler,ai,genai,llm,monitoring,observability,instrumentation,google-adk,adk,opentelemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fiddler-otel<2.0.0,>=1.0.0
Requires-Dist: google-adk>=1.34.2
Requires-Dist: opentelemetry-api>=1.37.0
Requires-Dist: opentelemetry-sdk>=1.37.0
Requires-Dist: opentelemetry-instrumentation>=0.58b0
Requires-Dist: opentelemetry-exporter-otlp>=1.37.0
Requires-Dist: pydantic>=2.0
Provides-Extra: examples
Requires-Dist: python-dotenv>=1.0.0; extra == "examples"

# fiddler-adk

Fiddler SDK for instrumenting [Google ADK](https://github.com/google/adk-python) (Agent Development Kit) with OpenTelemetry.

This package lives in the [fiddler-sdk](https://github.com/fiddler-labs/fiddler-sdk) monorepo under `packages/integrations/fiddler-adk/`. It depends on [`fiddler-otel`](../../fiddler-otel) for the OTel pipeline, span attributes, and span processing.

## Install

```bash
pip install fiddler-adk
```

## Usage

```python
from fiddler_otel import FiddlerClient
from fiddler_adk import GoogleADKInstrumentor

client = FiddlerClient(
    api_key='YOUR_API_KEY',
    application_id='YOUR_APPLICATION_ID',  # UUID4 from the Fiddler GenAI Applications page
    url='https://your-instance.fiddler.ai',
)
GoogleADKInstrumentor(client).instrument()

# Build and run ADK agents as usual — traces flow to Fiddler automatically.
```

## How it works

Google ADK emits OpenTelemetry spans natively (`invoke_agent`, `call_llm`,
`execute_tool`, ...) through a tracer that resolves against the **global**
tracer provider. `GoogleADKInstrumentor.instrument()`:

1. **Sets up an isolated Fiddler tracing pipeline.** Uses `FiddlerClient` to
   initialise a dedicated tracer, provider, processor, and OTLP exporter.
   The client's provider is promoted to global so ADK's `gcp.vertex.agent`
   tracer resolves to it.  The SDK operates in standalone mode — it does not
   interact with customer-configured tracers or providers.
2. **Propagates session identity.** ADK sets `gen_ai.conversation.id` on
   child spans (`invoke_agent`, `call_llm`, etc.) but not on the parent
   `invocation` root span. The `ADKSpanProcessor` backfills it to the root
   so the Fiddler UI can group all spans in a turn under the same session.

Span-type classification, content extraction (LLM input/output, tool I/O,
system instructions), and attribute normalization are handled by the Fiddler
backend — the SDK does not parse or transform ADK's content attributes.

### Supported versions

- `google-adk >= 1.34.2`
- `opentelemetry-api >= 1.37.0`
- Python 3.10+

### Content capture

ADK includes full LLM request/response payloads in span attributes by default.
Set `ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false` to disable ADK's payload
capture if your prompts may contain PII.

See `examples/` in this directory for a runnable agent.
