Skip to content

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.

Genkit automatically collects traces and metrics without requiring explicit configuration. Genkit stores the traces and the Developer UI displays them, so you can analyze a flow step-by-step with its inputs, outputs, and timing.

Metrics travel a separate path. Genkit records metric families for feature, flow, action, generate, and tool activity, including genkit/flow/latency and the token counters genkit/ai/generate/input/tokens and genkit/ai/generate/output/tokens. The full table is in Telemetry collection. The Developer UI does not display metrics: they only leave the process once an exporting plugin such as the Firebase plugin is installed. In production, Genkit can export both traces and metrics to Firebase Genkit Monitoring for further analysis.

Genkit provides a centralized logging system that you can configure using the logging module. One advantage of using the Genkit-provided logger is that it automatically exports logs to Genkit Monitoring when the Firebase Telemetry plugin is enabled.

import { logger } from 'genkit/logging';
// Set the desired log level
logger.setLogLevel('debug');

The Genkit Monitoring dashboard helps you understand the overall health of your Genkit features. It is also useful for debugging stability and content issues that may indicate problems with your LLM prompts and/or Genkit Flows. See the Getting Started guide for more details.