Skip to main content
Firebase Genkit for Go is OpenTelemetry-native: it already emits its own gen_ai.* spans for flows, models and tools onto the global OpenTelemetry tracer provider. The LangWatch Genkit package does no body parsing; it registers a LangWatch span processor on the tracer provider Genkit’s spans flow through, so whatever Genkit records (model, token usage, prompt/completion and tool data) is exported to LangWatch.

Installation

Usage

Set the LANGWATCH_API_KEY environment variable before running.
Register LangWatch once, after genkit.Init:
RegisterLangWatch reads LANGWATCH_API_KEY (and LANGWATCH_ENDPOINT) from the environment by default. To forward exporter options (API key, endpoint, data capture, filters), pass WithExporterOptions:
LangWatch captures whatever gen_ai.* attributes Genkit records; there is no extra parsing in this package. If you build your own sdktrace.TracerProvider, use lwgenkit.SpanProcessor(opts...) to obtain the processor and register it yourself (Genkit reads the global tracer provider).

Check it worked

Run one of your flows. Then open your project in LangWatch: a new trace appears in the traces list within a few seconds, with the spans Genkit recorded for the flow and its model calls. If no trace appears, check that LANGWATCH_API_KEY is set in the environment the program runs in.
Last modified on October 29, 2026