Skip to content

Local observability and metrics

Genkit Dart uses a pluggable instrumentation system that is decoupled from OpenTelemetry. By default Genkit is not instrumented.

In the dev environment, a built-in provider is auto-injected when a telemetry server is available, so the Developer UI works out of the box. It posts spans directly to the Genkit telemetry server over HTTP (no OTel dependency) and forwards package:logging records correlated with the active span.

To view traces locally:

  1. Start the Genkit Developer UI:
Terminal window
genkit start -- dart run
  1. Run your flow or action.
  2. Open the Developer UI (typically at http://localhost:4000) to view traces and metrics.

To send spans to your own platform, implement Instrumentation and stack one or more providers before creating your Genkit instance:

import 'package:genkit/telemetry.dart';
void main() {
configureInstrumentation(myInstrumentation());
// ... create Genkit and define your flows.
}

You do not have to write one for OpenTelemetry. The genkit_otel package ships a provider that follows the OTel GenAI semantic conventions; see OpenTelemetry GenAI semantic conventions.

Genkit Dart core records no metrics of its own. Metrics come from the instrumentation provider you configure: genkit_otel emits the two OpenTelemetry GenAI client metrics, token usage and operation duration. The Developer UI does not display metrics either way; they leave the process through your exporter. See OpenTelemetry GenAI semantic conventions.

There is no Genkit Monitoring plugin for Dart. For production observability, use genkit_otel to export traces and metrics to any OTLP-compatible backend; see OpenTelemetry GenAI semantic conventions.