Local observability and metrics
Genkit provides a robust set of built-in observability features, including tracing and metrics collection powered by OpenTelemetry. For local observability, such as during the development phase, the Genkit Developer UI provides detailed trace viewing and debugging capabilities. For production observability, we provide Genkit Monitoring in the Firebase console via the Firebase plugin. Alternatively, you can export your OpenTelemetry data to the observability tooling of your choice.
Tracing & metrics
Section titled “Tracing & metrics”Genkit automatically collects traces and metrics without requiring explicit configuration, allowing you to observe and debug your Genkit code’s behavior in the Developer UI. Genkit stores these traces, enabling you to analyze your Genkit flows step-by-step with detailed input/output logging and statistics. In production, Genkit can export traces and metrics to Firebase Genkit Monitoring for further analysis.
Log and export events
Section titled “Log and export events”Genkit Python uses structlog for logging. When the observability plugin is configured, logs automatically include trace context for correlation with your observability backend.
import structlog
logger = structlog.get_logger()
@ai.flow()async def my_flow(topic: str): logger.info('Starting flow', topic=topic) # ... flow logic