Skip to content

Commit f9f3c58

Browse files
authored
fix(attributes): improve gen_ai.operation.name description (#225)
1 parent 0f5058d commit f9f3c58

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#### Changes to attributes
88

9+
- fix(attributes): improve gen_ai.operation.name description ([#225](https://github.com/getsentry/sentry-conventions/pull/225))
910
- feat(ai): Add gen_ai.usage.input_tokens.cache_write ([#217](https://github.com/getsentry/sentry-conventions/pull/217))
1011
- feat(attributes): Add sentry.normalized_db_query.hash ([#200](https://github.com/getsentry/sentry-conventions/pull/200))
1112
- feat(attributes): Add sentry.category attribute ([#218](https://github.com/getsentry/sentry-conventions/pull/218))

generated/attributes/all.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Total attributes: 422
8282
| [`gen_ai.cost.total_tokens`](./gen_ai.md#gen_aicosttotal_tokens) | The total cost for the tokens used. |
8383
| [`gen_ai.embeddings.input`](./gen_ai.md#gen_aiembeddingsinput) | The input to the embeddings model. |
8484
| [`gen_ai.input.messages`](./gen_ai.md#gen_aiinputmessages) | The messages passed to the model. It has to be a stringified version of an array of objects. The `role` attribute of each object must be `"user"`, `"assistant"`, `"tool"`, or `"system"`. For messages of the role `"tool"`, the `content` can be a string or an arbitrary object with information about the tool call. For other messages the `content` can be either a string or a list of objects in the format `{type: "text", text:"..."}`. |
85-
| [`gen_ai.operation.name`](./gen_ai.md#gen_aioperationname) | The name of the operation being performed. |
85+
| [`gen_ai.operation.name`](./gen_ai.md#gen_aioperationname) | The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used. |
8686
| [`gen_ai.operation.type`](./gen_ai.md#gen_aioperationtype) | The type of AI operation. Must be one of 'agent', 'ai_client', 'tool', 'handoff', 'guardrail'. Makes querying for spans in the UI easier. |
8787
| [`gen_ai.output.messages`](./gen_ai.md#gen_aioutputmessages) | The model's response messages. It has to be a stringified version of an array of message objects, which can include text responses and tool calls. |
8888
| [`gen_ai.pipeline.name`](./gen_ai.md#gen_aipipelinename) | Name of the AI pipeline or chain being executed. |

generated/attributes/gen_ai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ The messages passed to the model. It has to be a stringified version of an array
148148

149149
### gen_ai.operation.name
150150

151-
The name of the operation being performed.
151+
The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used.
152152

153153
| Property | Value |
154154
| --- | --- |

javascript/sentry-conventions/src/attributes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ export type GEN_AI_INPUT_MESSAGES_TYPE = string;
21682168
// Path: model/attributes/gen_ai/gen_ai__operation__name.json
21692169

21702170
/**
2171-
* The name of the operation being performed. `gen_ai.operation.name`
2171+
* The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used. `gen_ai.operation.name`
21722172
*
21732173
* Attribute Value Type: `string` {@link GEN_AI_OPERATION_NAME_TYPE}
21742174
*
@@ -10767,7 +10767,8 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1076710767
'[{"role": "user", "parts": [{"type": "text", "content": "Weather in Paris?"}]}, {"role": "assistant", "parts": [{"type": "tool_call", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "name": "get_weather", "arguments": {"location": "Paris"}}]}, {"role": "tool", "parts": [{"type": "tool_call_response", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "result": "rainy, 57°F"}]}]',
1076810768
},
1076910769
[GEN_AI_OPERATION_NAME]: {
10770-
brief: 'The name of the operation being performed.',
10770+
brief:
10771+
"The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used.",
1077110772
type: 'string',
1077210773
pii: {
1077310774
isPii: 'maybe',

model/attributes/gen_ai/gen_ai__operation__name.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"key": "gen_ai.operation.name",
3-
"brief": "The name of the operation being performed.",
3+
"brief": "The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used.",
44
"type": "string",
55
"pii": {
66
"key": "maybe"

python/src/sentry_conventions/attributes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
13021302

13031303
# Path: model/attributes/gen_ai/gen_ai__operation__name.json
13041304
GEN_AI_OPERATION_NAME: Literal["gen_ai.operation.name"] = "gen_ai.operation.name"
1305-
"""The name of the operation being performed.
1305+
"""The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used.
13061306
13071307
Type: str
13081308
Contains PII: maybe
@@ -5646,7 +5646,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta):
56465646
example='[{"role": "user", "parts": [{"type": "text", "content": "Weather in Paris?"}]}, {"role": "assistant", "parts": [{"type": "tool_call", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "name": "get_weather", "arguments": {"location": "Paris"}}]}, {"role": "tool", "parts": [{"type": "tool_call_response", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "result": "rainy, 57°F"}]}]',
56475647
),
56485648
"gen_ai.operation.name": AttributeMetadata(
5649-
brief="The name of the operation being performed.",
5649+
brief="The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used.",
56505650
type=AttributeType.STRING,
56515651
pii=PiiInfo(isPii=IsPii.MAYBE),
56525652
is_in_otel=True,

0 commit comments

Comments
 (0)