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
* Add `gen_ai.tool.type` to `gen_ai.tool.execution.duration` metric
(recommended level, matching the `execute_tool` span). Addresses
MikeGoldsmith feedback.
* Explain in the doc why `gen_ai.tool.execution.duration` is recommended
while `gen_ai.agent.invocation.duration` is required (tool executions
may happen via paths the agent framework does not observe — external
MCP servers, app-managed dispatch, etc.). Addresses MikeGoldsmith
feedback.
Copy file name to clipboardExpand all lines: docs/gen-ai/gen-ai-metrics.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1021,6 +1021,13 @@ tools on behalf of an agent) that can reliably bound a single tool call.
1021
1021
This metric is [recommended][MetricRecommended] for instrumentations that can
1022
1022
observe tool executions performed by or on behalf of a GenAI agent.
1023
1023
1024
+
Unlike `gen_ai.agent.invocation.duration` (which is required), this metric is
1025
+
only recommended because tools may be executed through paths that the agent
1026
+
framework does not observe, such as external MCP servers or
1027
+
application-managed dispatch. Instrumentations SHOULD record this metric for
1028
+
every tool execution they observe, but are not required to capture all tool
1029
+
calls across the agentic system.
1030
+
1024
1031
When this metric is reported alongside a `gen_ai.execute_tool` span, the
1025
1032
metric value SHOULD be the same as the span duration.
1026
1033
@@ -1048,6 +1055,7 @@ When this metric is reported alongside a `gen_ai.execute_tool` span, the metric
1048
1055
|[`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`|
1049
1056
|[`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`|
1050
1057
|[`gen_ai.tool.version`](/docs/registry/attributes/gen-ai.md)||`Conditionally Required` when available | string | The version of the tool utilized by the agent. [2]|`1.0.0`; `2025-05-01`|
1058
+
|[`gen_ai.tool.type`](/docs/registry/attributes/gen-ai.md)||`Recommended`| string | Type of the tool utilized by the agent [3]|`function`; `extension`; `datastore`|
1051
1059
1052
1060
**[1]`error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library,
1053
1061
the canonical name of exception that occurred, or another low-cardinality error identifier.
@@ -1059,6 +1067,12 @@ tool's package) and is expected to have low cardinality.
1059
1067
1060
1068
`gen_ai.tool.version` MUST have low cardinality.
1061
1069
1070
+
**[3]`gen_ai.tool.type`:** Extension: A tool executed on the agent-side to directly call external APIs, bridging the gap between the agent and real-world systems.
1071
+
Agent-side operations involve actions that are performed by the agent on the server or within the agent's controlled environment.
1072
+
Function: A tool executed on the client-side, where the agent generates parameters for a predefined function, and the client executes the logic.
1073
+
Client-side operations are actions taken on the user's end or within the client application.
1074
+
Datastore: A tool used by the agent to access and query structured or unstructured external data for retrieval-augmented tasks or knowledge updates.
1075
+
1062
1076
---
1063
1077
1064
1078
`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.
0 commit comments