PulseAugur
EN
LIVE 22:36:25

Dev details LLM cost tracking with custom span attributes

A developer has detailed how to implement custom span attributes within OpenTelemetry to track Large Language Model (LLM) costs more effectively. By adding attributes like `team.id`, `feature.id`, and `llm.model` to spans, organizations can identify cost regressions at a granular level, such as per team or per feature, before they significantly impact billing. This approach, utilizing tools like Tempo and Grafana for querying and alerting, proved more effective than standard trace-level debugging or org-level dashboards in catching unexpected cost spikes. AI

IMPACT Provides a practical method for developers to monitor and control LLM operational expenses, crucial for efficient AI deployment.

RANK_REASON The article describes a technical implementation for monitoring and managing LLM costs using existing observability tools, which falls under tooling.

Read on dev.to — LLM tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

COVERAGE [1]

  1. dev.to — LLM tag TIER_1 English(EN) · Jasmine Park ·

    Span attributes that catch LLM cost regressions before billing does

    <p>The default OTel + OpenInference span has <code>llm.tokens.input</code> and <code>llm.tokens.output</code> as numeric attributes. Useful for trace-level debugging. Not useful for per-team cost regressions, because nothing groups traces by team.</p> <p>The 3 attribute additions…