You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following lmolkova's review and trask's towncrier reminder:
* Rename per #249 (lmolkova confirmed on PR #201 SIG call discussion):
- gen_ai.agent.invocation.duration -> gen_ai.invoke_agent.duration
- gen_ai.tool.execution.duration -> gen_ai.execute_tool.duration
Metric names now align with the operation name on spans
(gen_ai.invoke_agent, gen_ai.execute_tool).
* Move CHANGELOG entry to a Towncrier fragment per trask's reminder
about #275: changelog.d/201.enhancement.md.
* Bump gen_ai.agent.name from 'recommended' back to 'conditionally_required:
When available.' (lmolkova: keep consistent with the internal invoke_agent
span; entity work in #270 will reshape this later anyway).
* Capitalize 'When available' / 'If available' per #245 sentence-case
convention on every requirement_level note.
* Apply lmolkova's suggested rewrites on metric briefs/notes:
- Agent: more concise brief about the invocation start/end.
- Tool: drop 'performed by or on behalf of a GenAI agent' since
generic apps (not just agents) can execute tools.
- Tool note: simplify the requirement statement (drops the
explicit 'required vs recommended' framing; semconv is moving
away from those labels for metrics per
open-telemetry/semantic-conventions#3278).
* Add a few more low-cardinality attributes on invoke_agent.duration
per lmolkova: gen_ai.agent.id, gen_ai.agent.version, gen_ai.request.model
(all conditionally_required When/If available). They mirror what the
invoke_agent span carries and will be reshaped once #270 introduces
agent entities.
Add `gen_ai.invoke_agent.duration` metric to track the end-to-end duration of a single agent invocation, and `gen_ai.execute_tool.duration` metric to track the duration of a single tool execution.
|`gen_ai.agent.invocation.duration`| Histogram |`s`| The end-to-end duration of a single agent invocation, from the moment the agent is invoked to the moment it produces its final response (or terminates with an error). [1]|||
958
+
|`gen_ai.invoke_agent.duration`| Histogram |`s`| The end-to-end duration of a single agent invocation, from the moment the invocation starts until the agent emits the last chunk of its final response or terminates with an error. [1]|||
959
959
960
960
**[1]:** Intended for instrumentations of agent frameworks (for example, ADK,
961
961
LangChain agents, CrewAI agents) that can reliably bound a single
@@ -978,12 +978,18 @@ the metric value SHOULD be the same as the span duration.
978
978
| Key | Stability |[Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/)| Value Type | Description | Example Values |
979
979
| --- | --- | --- | --- | --- | --- |
980
980
|[`error.type`](https://github.com/open-telemetry/semantic-conventions/blob/v1.41.1/docs/registry/attributes/error.md)||`Conditionally Required` If the operation ended in an error. | string | Describes a class of error the operation ended with. [1]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|
981
-
|[`gen_ai.agent.name`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required` when available | string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`|
981
+
|[`gen_ai.agent.id`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required` When available. | string | The unique and stable identifier of the GenAI hosted agent resource. [2]|`asst_5j66UpCpwteGg4YSxUnt7lPY`; `arn:aws:bedrock:us-east-1:123:agent/42`; `urn:agent:projects-123:projects:123:locations:us-east1:aiplatform:reasoningEngines:456`|
982
+
|[`gen_ai.agent.name`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required` When available. | string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`|
983
+
|[`gen_ai.agent.version`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required` When available. | string | The version of the GenAI agent. |`1.0.0`; `2025-05-01`|
984
+
|[`gen_ai.request.model`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required` If available. | string | The name of the GenAI model a request is being made to. |`gpt-4`|
982
985
983
986
**[1]`error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library,
984
987
the canonical name of exception that occurred, or another low-cardinality error identifier.
985
988
Instrumentations SHOULD document the list of errors they report.
986
989
990
+
**[2]`gen_ai.agent.id`:** For hosted agents, this SHOULD be the provider-assigned stable identifier of the agent resource such as [AWS Bedrock agent ARN](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_Agent.html) or [GCP Agent Registry identifier](https://docs.cloud.google.com/agent-registry/concepts#agent-identifier).
991
+
It's NOT RECOMMENDED to record in-memory agent instance ids on this attribute due to their transient nature.
992
+
987
993
---
988
994
989
995
`error.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
@@ -1001,34 +1007,25 @@ Instrumentations SHOULD document the list of errors they report.
1001
1007
Individual systems may include additional system-specific attributes.
1002
1008
It is recommended to check system-specific documentation, if available.
1003
1009
1004
-
### Metric: `gen_ai.tool.execution.duration`
1010
+
### Metric: `gen_ai.execute_tool.duration`
1005
1011
1006
1012
This metric is [recommended][MetricRecommended] for instrumentations that can
1007
-
observe tool executions performed by or on behalf of a GenAI agent.
1013
+
observe tool executions.
1008
1014
1009
1015
This metric SHOULD be specified with [ExplicitBucketBoundaries] of
|`gen_ai.tool.execution.duration`| Histogram |`s`| The duration of a single tool execution performed by or on behalf of a GenAI agent. [1]|||
1020
-
1021
-
**[1]:** Intended for instrumentations of agent frameworks (or of application
1022
-
code that executes tools on behalf of an agent) that can reliably
1023
-
bound a single tool call.
1025
+
|`gen_ai.execute_tool.duration`| Histogram |`s`| The duration of a single tool execution. [1]|||
1024
1026
1025
-
Unlike `gen_ai.agent.invocation.duration` (which is required), this
1026
-
metric is only recommended because tools may be executed through
1027
-
paths that the agent framework does not observe — for example,
1028
-
external MCP servers or application-managed dispatch.
1029
-
Instrumentations SHOULD record this metric for every tool execution
1030
-
they observe but are not required to capture all tool calls across
1031
-
the agentic system.
1027
+
**[1]:** Instrumentation that can reliably bound a single tool call SHOULD
1028
+
record this metric for every tool execution they can observe.
1032
1029
1033
1030
When this metric is reported alongside a `gen_ai.execute_tool` span,
1034
1031
the metric value SHOULD be the same as the span duration.
@@ -1039,7 +1036,7 @@ the metric value SHOULD be the same as the span duration.
1039
1036
| --- | --- | --- | --- | --- | --- |
1040
1037
|[`gen_ai.tool.name`](/docs/registry/attributes/gen-ai.md)||`Required`| string | Name of the tool utilized by the agent. |`Flights`|
1041
1038
|[`error.type`](https://github.com/open-telemetry/semantic-conventions/blob/v1.41.1/docs/registry/attributes/error.md)||`Conditionally Required` If the operation ended in an error. | string | Describes a class of error the operation ended with. [1]|`timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500`|
1042
-
|[`gen_ai.agent.name`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required`when available | string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`|
1039
+
|[`gen_ai.agent.name`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required`When available.| string | Human-readable name of the GenAI agent provided by the application. |`Math Tutor`; `Fiction Writer`|
1043
1040
|[`gen_ai.tool.type`](/docs/registry/attributes/gen-ai.md)||`Recommended`| string | Type of the tool utilized by the agent [2]|`function`; `extension`; `datastore`|
1044
1041
1045
1042
**[1]`error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library,
0 commit comments