Lessons from Building an OTel Normalizer for GenAI

· ai ai-agents cloud · Source ↗

TLDR

  • groundcover built a GenAI OTel normalizer across SDK x Framework x Provider dimensions and found the “standard” is a maze of naming conflicts and structural mismatches.

Key Takeaways

  • Four wire formats cover all incoming GenAI spans: Traceloop/LangChain (A), LangSmith (B), canonical gen_ai.* (C), and future OTel events (D, partial).
  • Six different attribute keys can hold the model name; token counts have five naming conventions across SDKs requiring a priority resolution chain.
  • Anthropic and Bedrock count cache tokens additively; OpenAI does not – generic OTel backends silently undercount costs without provider-specific arithmetic.
  • Provider name normalization requires a 26-entry map to collapse case variants, abbreviations, and gateway prefixes into 15 canonical strings.
  • Framework axis (LangGraph, CrewAI, Pydantic AI) affects span tree shape and message serialization even when SDK and provider are identical.

Hacker News Comment Review

  • No substantive HN discussion yet.

Original | Discuss on HN