feat(tracing): provider-agnostic exporters with first-class PostHog support - #970
Closed
Spherrrical wants to merge 1 commit into
Closed
feat(tracing): provider-agnostic exporters with first-class PostHog support#970Spherrrical wants to merge 1 commit into
Spherrrical wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a provider-agnostic telemetry export layer to brightstaff, driven by a new
tracing.exportersconfig list, and ships PostHog as the first first-class integration. Users point at their PostHog URL + project token and every LLM call is streamed as a$ai_generationevent — as simple as LiteLLM'sposthogcallback.Changes
tracing.exporters[](schema +Exporter/PosthogExporterincommon), extensible to other backends via an internally-tagged enum.SpanExporter(posthog_exporter.rs) that filters LLM spans, maps attributes to$ai_*properties (model, provider, latency, tokens, http status, trace ids), and POSTs a/batch/payload via reqwest. Failures are logged and dropped, never blocking requests.init_tracernow composes multiple batch exporters (OTLP + each PostHog exporter); enable gate decoupled so PostHog works withoutopentracing_grpc_endpoint.AppState, stamped on the span asplano.distinct_id; anonymous fallback (\$process_person_profile=false).llm.provider.capture_messagesopt-in sends the truncated user preview as$ai_input.Note: stacked on
musa/agent-skills-support(PR #954) to keep this diff scoped to the PostHog work.