Skip to content

Commit 2b38207

Browse files
committed
Address review comments on PR #201
* 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.
1 parent ba3da34 commit 2b38207

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

docs/gen-ai/gen-ai-metrics.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,13 @@ tools on behalf of an agent) that can reliably bound a single tool call.
10211021
This metric is [recommended][MetricRecommended] for instrumentations that can
10221022
observe tool executions performed by or on behalf of a GenAI agent.
10231023

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+
10241031
When this metric is reported alongside a `gen_ai.execute_tool` span, the
10251032
metric value SHOULD be the same as the span duration.
10261033

@@ -1048,6 +1055,7 @@ When this metric is reported alongside a `gen_ai.execute_tool` span, the metric
10481055
| [`gen_ai.agent.name`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` when available | string | Human-readable name of the GenAI agent provided by the application. | `Math Tutor`; `Fiction Writer` |
10491056
| [`gen_ai.agent.version`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` when available | string | The version of the GenAI agent. | `1.0.0`; `2025-05-01` |
10501057
| [`gen_ai.tool.version`](/docs/registry/attributes/gen-ai.md) | ![Development](https://img.shields.io/badge/-development-blue) | `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) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | Type of the tool utilized by the agent [3] | `function`; `extension`; `datastore` |
10511059

10521060
**[1] `error.type`:** The `error.type` SHOULD match the error code returned by the Generative AI provider or the client library,
10531061
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.
10591067

10601068
`gen_ai.tool.version` MUST have low cardinality.
10611069

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+
10621076
---
10631077

10641078
`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.

model/gen-ai/metrics.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ metrics:
154154
- ref_group: attributes.gen_ai.error
155155
- ref: gen_ai.tool.name
156156
requirement_level: required
157+
- ref: gen_ai.tool.type
158+
requirement_level: recommended
157159
- ref: gen_ai.tool.version
158160
requirement_level:
159161
conditionally_required: when available

schema-snapshot/registry.yaml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)