Skip to content

AI observability: support Firebase Genkit (Vertex AI) #62675

@christiaan-ph

Description

@christiaan-ph

Is your feature request related to a problem?

I build my AI features with Firebase Genkit, calling models through Vertex AI. There is currently no way to get Genkit traces and generations into PostHog AI observability: none of the @posthog/ai integrations (OpenAI, Anthropic, Gemini, LangChain, OpenAI Agents, Vercel AI SDK) cover Genkit, so apps built on it have no instrumentation path.

Describe the solution you'd like

First-class Genkit support in AI observability, so that flows, model calls, and tool calls made through Genkit (including via Vertex AI) show up as traces and generations.

The most natural implementation path looks like extending the existing OpenTelemetry integration. Genkit instruments itself with OpenTelemetry out of the box, and @posthog/ai already ships a PostHogSpanProcessor / PostHogTraceExporter that converts AI spans into AI observability events. However, that processor only recognizes spans whose name or attribute keys start with gen_ai., llm., ai., or traceloop. (see isAISpan in packages/ai/src/otel/spans.ts), while Genkit uses its own genkit: attribute namespace (genkit:type, genkit:input, genkit:output, etc.). Teaching the span processor to understand Genkit's span conventions, or shipping a small dedicated Genkit telemetry plugin, would close the gap.

Describe alternatives you've considered

  • Calling Vertex AI directly through the @google/genai SDK with PostHog's Gemini integration works today, but that means giving up the Genkit framework layer (flows, prompts, tool orchestration).
  • Wiring Genkit's OpenTelemetry output to the existing PostHog OTel exporter does not work as-is, because Genkit spans don't match the recognized AI span prefixes.

Additional context

Debug info

  • PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
  • PostHog Hobby self-hosted with docker compose, version/commit: [please provide]
  • PostHog self-hosted with Kubernetes (deprecated, see Sunsetting Kubernetes support), version/commit: [please provide]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions