Observed since 20 Oct, 19:36 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Wide Event Logging & Observability for Google ADK Agents
adk-agentic-logging transforms the observability of AI agents from a fragmented stream of text into a structured, queryable dataset.
Its core philosophy is the "Wide Event" model: capturing the entire lifecycle of an agentic interaction—including HTTP context, OpenTelemetry trace headers, and deep ADK internal state—into a single, high-cardinality JSON artifact per request.
By seamlessly bridging web frameworks with Google Cloud’s ecosystem, it enforces a "zero-config" standard that eliminates scattered debug prints, turning complex AI behavior into transparent insights from day one.
trace_id and span_id for seamless Cloud Trace linking.# Core library
uv pip install adk-agentic-logging
# With Google Cloud Tracing capabilities
uv pip install "adk-agentic-logging[google-adk]"
The configure_logging function is your unified entry point for observability. It activates full Google Cloud Tracing or Console Tracing with a single line of code, handling OTel configuration and GCP project detection automatically.
Crucially, adk-agentic-logging is lazy. It will not touch OpenTelemetry or initialize any SDK providers until you explicitly call configure_logging().
By default, console tracing is enabled with beautiful Rich formatting.
from adk_agentic_logging import configure_logging
# Console tracing is ON by default
configure_logging()
Enable GCP export for production. If project_id is omitted, it is auto-detected from the environment.
configure_logging(enable_google_tracing=True)
You can toggle exporters independently and specify an explicit project ID.
configure_logging(
enable_google_tracing=True,
enable_console_tracing=False, # Silence console logs in production
project_id="my-custom-gcp-project"
)
| Parameter | Default | Description |
|---|---|---|
enable_google_tracing | False | Enables export to Google Cloud Trace. Requires [google-adk] extra. |
enable_console_tracing | True | Enables local console output via RichConsoleSpanExporter. |
project_id | None | Explicit GCP Project ID. If None, auto-detects from metadata or env. |
[!TIP] This unified configuration automatically manages
BatchSpanProcessorsettings, environment variables for log correlation, and instruments the Google Generative AI SDK if installed.
from fastapi import FastAPI
from adk_agentic_logging.integrations.fastapi import AgenticLoggingMiddleware
app = FastAPI()
app.add_middleware(AgenticLoggingMiddleware)
from flask import Flask
from adk_agentic_logging.integrations.flask import AgenticLogging
app = Flask(__name__)
agentic_logging = AgenticLogging(app)
Add to your MIDDLEWARE in settings.py:
MIDDLEWARE = [
...,
"adk_agentic_logging.integrations.django.AgenticLoggingMiddleware",
...,
]
Use @instrument_runner to automatically capture internal state from your ADK runners.
from adk_agentic_logging.adk.instrumentation import instrument_runner
class MyAgentRunner:
@instrument_runner
def run(self, runner_input, **kwargs):
# Your ADK agent logic
return result
You can explicitly enrich the wide event with any context, such as the user's question and the agent's response, using log_ctx.
from adk_agentic_logging import log_ctx
# In your agent logic or route handler
log_ctx.enrich(
question="What is the weather in Paris?",
response="The weather in Paris is sunny with 22°C."
)
Adding these fields makes your logs easily queryable for specific interactions.
Traces can become expensive if they capture massive LLM prompts and responses. adk-agentic-logging includes a Vertex AI Sanitizer that automatically strips these large payloads from your traces (Waterfall UI) while keeping them safely in your structured logs.
This gives you the best of both worlds: lightweight, low-cost Waterfall traces and full-fidelity logs for debugging.
The sanitizer is enabled by default when you use configure_logging().
# Everything is handled: OTel, Exporters, and Sanitization
configure_logging(enable_google_tracing=True)
This project is licensed under the terms of the MIT license.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.0 | 22 Jan 2026 | 17 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:36 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:f9df5b5a3a4638d9feb24027f842ff3c99bf1bb30fba9e407e8f6d3290739966