Skip to content

Commit f525888

Browse files
committed
Update metrics to be for 'client'
1 parent 9ba39f6 commit f525888

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ linkTitle: Generative AI metrics
66

77
**Status**: [Experimental][DocumentStatus]
88

9-
The conventions described in this section are specific to Generative AI
9+
The conventions described in this section are specific to Generative AI client
1010
applications.
1111

1212
**Disclaimer:** These are initial Generative AI client metric instruments
@@ -16,19 +16,19 @@ and attributes but more may be added in the future.
1616

1717
<!-- toc -->
1818

19-
- [Generative AI Operations](#generative-ai-operations)
20-
- [Metric: `gen_ai.token.usage`](#metric-gen_aitokenusage)
21-
- [Metric: `gen_ai.operation.duration`](#metric-gen_aioperationduration)
19+
- [Generative AI Client Metrics](#generative-ai-client-metrics)
20+
- [Metric: `gen_ai.client.token.usage`](#metric-gen_aiclienttokenusage)
21+
- [Metric: `gen_ai.client.operation.duration`](#metric-gen_aiclientoperationduration)
2222

2323
<!-- tocstop -->
2424

25-
## Generative AI Operations
25+
## Generative AI Client Metrics
2626

2727
The following metric instruments describe Generative AI operations. An
2828
operation may be a request to an LLM, a function call, or some other
2929
distinct action within a larger Generative AI workflow.
3030

31-
### Metric: `gen_ai.token.usage`
31+
### Metric: `gen_ai.client.token.usage`
3232

3333
This metric is [recommended][MetricRecommended] when an operation involves the usage
3434
of tokens and the count is readily available.
@@ -39,13 +39,13 @@ If instrumentation cannot efficiently obtain number of input and/or output token
3939

4040
This metric SHOULD be specified with [ExplicitBucketBoundaries] of [1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864].
4141

42-
<!-- semconv metric.gen_ai.token.usage(metric_table) -->
42+
<!-- semconv metric.gen_ai.client.token.usage(metric_table) -->
4343
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
4444
| -------- | --------------- | ----------- | -------------- | --------- |
45-
| `gen_ai.token.usage` | Histogram | `{token}` | Measures number of input and output tokens used | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
45+
| `gen_ai.client.token.usage` | Histogram | `{token}` | Measures number of input and output tokens used | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
4646
<!-- endsemconv -->
4747

48-
<!-- semconv metric.gen_ai.token.usage(full) -->
48+
<!-- semconv metric.gen_ai.client.token.usage(full) -->
4949
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
5050
|---|---|---|---|---|---|
5151
| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. | `chat`; `completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
@@ -87,19 +87,19 @@ Additional details may be captured in domain-specific attributes.
8787
| `_OTHER` | A fallback error value to be used when the instrumentation doesn't define a custom value. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
8888
<!-- endsemconv -->
8989

90-
### Metric: `gen_ai.operation.duration`
90+
### Metric: `gen_ai.client.operation.duration`
9191

9292
This metric is [required][MetricRequired].
9393

9494
This metric SHOULD be specified with [ExplicitBucketBoundaries] of [ 0.01, 0.02, 0.04, 0.08, 0.16, 0.32, 0.64, 1.28, 2.56, 5.12,10.24, 20.48, 40.96, 81.92].
9595

96-
<!-- semconv metric.gen_ai.operation.duration(metric_table) -->
96+
<!-- semconv metric.gen_ai.client.operation.duration(metric_table) -->
9797
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
9898
| -------- | --------------- | ----------- | -------------- | --------- |
99-
| `gen_ai.operation.duration` | Histogram | `s` | GenAI operation duration | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
99+
| `gen_ai.client.operation.duration` | Histogram | `s` | GenAI operation duration | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
100100
<!-- endsemconv -->
101101

102-
<!-- semconv metric.gen_ai.operation.duration(full) -->
102+
<!-- semconv metric.gen_ai.client.operation.duration(full) -->
103103
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
104104
|---|---|---|---|---|---|
105105
| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. | `chat`; `completion` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

model/metrics/gen-ai.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ groups:
2525
requirement_level: required
2626
- ref: gen_ai.operation.name
2727
requirement_level: required
28-
- id: metric.gen_ai.token.usage
28+
- id: metric.gen_ai.client.token.usage
2929
type: metric
30-
metric_name: gen_ai.token.usage
30+
metric_name: gen_ai.client.token.usage
3131
brief: 'Measures number of input and output tokens used'
3232
instrument: histogram
3333
unit: "{token}"
@@ -36,9 +36,9 @@ groups:
3636
attributes:
3737
- ref: gen_ai.token.type
3838
requirement_level: required
39-
- id: metric.gen_ai.operation.duration
39+
- id: metric.gen_ai.client.operation.duration
4040
type: metric
41-
metric_name: gen_ai.operation.duration
41+
metric_name: gen_ai.client.operation.duration
4242
brief: 'GenAI operation duration'
4343
instrument: histogram
4444
unit: "s"

0 commit comments

Comments
 (0)