From Discord: OTEL Traces and GenAI Spec Compliance for model.streamText
Summary
The discussion revolves around the OTEL traces generated by model.streamText not fully adhering to the latest OpenTelemetry GenAI semantic conventions. @jonas69301 shared a custom TypeScript snippet to attach input/output attributes to spans for better rendering in langfuse because the default spans lacked these details. However, @maxwellbrown explained that input/output data isn't attached by default to avoid large data ingestion costs for telemetry providers. The GenAI semantic conventions spec has evolved over time, and current implementations follow an older version. There's agreement on potentially adding a flag to opt-in for adding input/output attributes to spans, improving compatibility with platforms like langfuse and traceloop. An issue will be created to update support for the latest GenAI spec attributes and introduce opt-in flags for heavy attributes.
Discord thread
https://discord.com/channels/795981131316985866/1445421205699170325
Relevant Links
- https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/
- https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/