Skip to content

epic: GenAI metrics under the semantic conventions across otel, prometheus and grafana #3039

Closed
5 of 6 issues completed

Description

@lex00

The otel lexicon's GenAI preset (#2900, #2912) derives four metrics from spans under names of its own (genai.calls, genai.duration, genai.tokens.input, genai.tokens.output). grafana AgentDashboard reads them. The GenAI semantic conventions define the metrics that backends and dashboards expect instead: operation duration and token usage at the lexicon's pin (semantic-conventions v1.41.1), and agent, tool, workflow, cache, reasoning and MCP metrics on the unreleased main of open-telemetry/semantic-conventions-genai. This epic has the collector emit those under their real names where spans allow it, and adds the rules and dashboard that go with them.

Everything here is opt-in. A project that builds genAiPipeline() today gets byte-identical output unless it asks for the new metrics.

Sub-issues

# Issue Depends on
1 #3040 otel: typed signal_to_metrics connector
2 #3041 otel: the v1.41.1 client metrics under their convention names #3040
3 #3044 otel: agent, tool, workflow, cache, reasoning and MCP metrics from semantic-conventions-genai #3041, the pin decision in #2913
4 #3042 otel lint: high-cardinality GenAI attributes as metric attributes #3040 for its fields
5 #3043 prometheus: GenAI recording rules, alerts, and cost from a declared price table #3041; #3044 for agent and tool rules
6 #3045 grafana: AgentDashboard for the conventions' metrics #3041, #3043; #3044 for some panels

#2913 carries the prerequisites: deltatocumulative (these connectors emit deltas, so remote write needs it), the sum connector bug (#3041 routes tokens around it), and the semantic-conventions-genai pin #3044 waits on. It stays a sub-issue of #2904, the closed epic it came from, and this epic depends on it.

What the collector can't derive

Some of the conventions' metrics need the whole agent run or the stream's timing, which one span doesn't carry. The collector passes these through from the SDK and derives nothing:

  • gen_ai.invoke_agent.inference_calls and gen_ai.invoke_agent.tool_calls
  • gen_ai.client.operation.time_per_output_chunk
  • gen_ai.client.operation.time_to_first_chunk at v1.41.1
  • the gen_ai.server.* metrics

#3043 computes the average calls per run as a ratio of rates.

Related

Definition of done

  • A collector built with the option emits the conventions' metrics that spans allow, with the attributes, units and buckets the conventions give.
  • The same project's prometheus rules and grafana dashboard build from the collector's GenAiMetrics without restating any metric name.
  • Output without the option is unchanged.
  • Every sub-issue is closed or explicitly re-scoped.

Sub-issues

Sub-issues

5 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added
    enhancement
    epic
    area:otel
    followup:lexicon-maturity
    on Sep 30, 2026
  2. lex00 commented on Oct 23, 2026

    @lex00
    ContributorAuthor

    Closing as done for the semantic-conventions v1.41.1 half. 5 of the 6 sub-issues are closed (#3040, #3041, #3042, #3043, #3045), and the prerequisite #2913 is closed too. #3044 (agent, tool, workflow, cache, reasoning and MCP metrics from semantic-conventions-genai) stays open as a standalone issue. It waits on #3073, the move of the pin to semantic-conventions-genai, which in turn waits for that repo to tag a release. No further work on this epic is possible until then, and #3378 already lists #3044 and #3073 as outside its scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:otelenhancementepicfollowup:lexicon-maturity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions