You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ai): replace otel client-side span mapping with PostHogTraceExporter (#3232)
* Replace otel client-side span mapping with PostHogTraceExporter
Replace the PostHogSpanProcessor (which did client-side span mapping
via posthog-node) with PostHogTraceExporter, a thin wrapper around
OTLPTraceExporter that points to PostHog's /i/v0/ai/otel endpoint.
PostHog now handles gen_ai.* span conversion to $ai_generation events
server-side, so the client no longer needs the mapper pipeline.
* fix(ai): address PR review feedback
Use URL.origin for trailing slash handling instead of regex, add inline
comment on auth header, consolidate tests into it.each, add changeset.
* fix(ai): add apiKey validation, clean up unused deps, improve tests
Remove @opentelemetry/sdk-trace-base from peer and dev dependencies
since it's no longer imported after the exporter rewrite. Add apiKey
validation to PostHogTraceExporter constructor. Assert on mock
constructor args instead of internal _config in tests.
* switch to gpt-5-mini
* fix otel for convex
Replace otel client-side span mapping with PostHogTraceExporter. PostHog now converts gen_ai.* spans into $ai_generation events server-side, so the client-side mapper pipeline (PostHogSpanProcessor, captureSpan, aiSdkSpanMapper) has been replaced with a simple OTLPTraceExporter wrapper.
Use this when working with Vercel AI SDK telemetry. `@posthog/ai` exposes an OTEL `SpanProcessor` that maps spans to PostHog AI events and sends them through `posthog-node`.
44
+
`@posthog/ai` provides a `PostHogTraceExporter` that sends OpenTelemetry traces to PostHog's OTLP ingestion endpoint. PostHog converts `gen_ai.*` spans into `$ai_generation` events server-side. This works with any LLM provider SDK that supports OpenTelemetry.
0 commit comments