Skip to content

Commit 1693576

Browse files
authored
feat(attributes): add gen_ai.provider.name, deprecate gen_ai.system, remove unused gen_ai attributes (#253)
1 parent 9c640b6 commit 1693576

File tree

9 files changed

+109
-199
lines changed

9 files changed

+109
-199
lines changed

javascript/sentry-conventions/src/attributes.ts

Lines changed: 45 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ export type AI_MODEL_ID_TYPE = string;
252252
*
253253
* Attribute defined in OTEL: No
254254
*
255-
* Aliases: {@link GEN_AI_SYSTEM} `gen_ai.system`
255+
* Aliases: {@link GEN_AI_PROVIDER_NAME} `gen_ai.provider.name`, {@link GEN_AI_SYSTEM} `gen_ai.system`
256256
*
257-
* @deprecated Use {@link GEN_AI_SYSTEM} (gen_ai.system) instead
257+
* @deprecated Use {@link GEN_AI_PROVIDER_NAME} (gen_ai.provider.name) instead
258258
* @example "openai"
259259
*/
260260
export const AI_MODEL_PROVIDER = 'ai.model.provider';
@@ -2125,46 +2125,6 @@ export const GEN_AI_AGENT_NAME = 'gen_ai.agent.name';
21252125
*/
21262126
export type GEN_AI_AGENT_NAME_TYPE = string;
21272127

2128-
// Path: model/attributes/gen_ai/gen_ai__assistant__message.json
2129-
2130-
/**
2131-
* The assistant message passed to the model. `gen_ai.assistant.message`
2132-
*
2133-
* Attribute Value Type: `string` {@link GEN_AI_ASSISTANT_MESSAGE_TYPE}
2134-
*
2135-
* Contains PII: true
2136-
*
2137-
* Attribute defined in OTEL: No
2138-
*
2139-
* @example "get_weather tool call"
2140-
*/
2141-
export const GEN_AI_ASSISTANT_MESSAGE = 'gen_ai.assistant.message';
2142-
2143-
/**
2144-
* Type for {@link GEN_AI_ASSISTANT_MESSAGE} gen_ai.assistant.message
2145-
*/
2146-
export type GEN_AI_ASSISTANT_MESSAGE_TYPE = string;
2147-
2148-
// Path: model/attributes/gen_ai/gen_ai__choice.json
2149-
2150-
/**
2151-
* The model's response message. `gen_ai.choice`
2152-
*
2153-
* Attribute Value Type: `string` {@link GEN_AI_CHOICE_TYPE}
2154-
*
2155-
* Contains PII: true
2156-
*
2157-
* Attribute defined in OTEL: No
2158-
*
2159-
* @example "The weather in Paris is rainy and overcast, with temperatures around 57°F"
2160-
*/
2161-
export const GEN_AI_CHOICE = 'gen_ai.choice';
2162-
2163-
/**
2164-
* Type for {@link GEN_AI_CHOICE} gen_ai.choice
2165-
*/
2166-
export type GEN_AI_CHOICE_TYPE = string;
2167-
21682128
// Path: model/attributes/gen_ai/gen_ai__conversation__id.json
21692129

21702130
/**
@@ -2388,6 +2348,28 @@ export const GEN_AI_PROMPT = 'gen_ai.prompt';
23882348
*/
23892349
export type GEN_AI_PROMPT_TYPE = string;
23902350

2351+
// Path: model/attributes/gen_ai/gen_ai__provider__name.json
2352+
2353+
/**
2354+
* The Generative AI provider as identified by the client or server instrumentation. `gen_ai.provider.name`
2355+
*
2356+
* Attribute Value Type: `string` {@link GEN_AI_PROVIDER_NAME_TYPE}
2357+
*
2358+
* Contains PII: maybe
2359+
*
2360+
* Attribute defined in OTEL: Yes
2361+
*
2362+
* Aliases: {@link AI_MODEL_PROVIDER} `ai.model.provider`, {@link GEN_AI_SYSTEM} `gen_ai.system`
2363+
*
2364+
* @example "openai"
2365+
*/
2366+
export const GEN_AI_PROVIDER_NAME = 'gen_ai.provider.name';
2367+
2368+
/**
2369+
* Type for {@link GEN_AI_PROVIDER_NAME} gen_ai.provider.name
2370+
*/
2371+
export type GEN_AI_PROVIDER_NAME_TYPE = string;
2372+
23912373
// Path: model/attributes/gen_ai/gen_ai__request__available_tools.json
23922374

23932375
/**
@@ -2785,8 +2767,9 @@ export type GEN_AI_RESPONSE_TOOL_CALLS_TYPE = string;
27852767
*
27862768
* Attribute defined in OTEL: Yes
27872769
*
2788-
* Aliases: {@link AI_MODEL_PROVIDER} `ai.model.provider`
2770+
* Aliases: {@link AI_MODEL_PROVIDER} `ai.model.provider`, {@link GEN_AI_PROVIDER_NAME} `gen_ai.provider.name`
27892771
*
2772+
* @deprecated Use {@link GEN_AI_PROVIDER_NAME} (gen_ai.provider.name) instead
27902773
* @example "openai"
27912774
*/
27922775
export const GEN_AI_SYSTEM = 'gen_ai.system';
@@ -3191,26 +3174,6 @@ export const GEN_AI_USAGE_TOTAL_TOKENS = 'gen_ai.usage.total_tokens';
31913174
*/
31923175
export type GEN_AI_USAGE_TOTAL_TOKENS_TYPE = number;
31933176

3194-
// Path: model/attributes/gen_ai/gen_ai__user__message.json
3195-
3196-
/**
3197-
* The user message passed to the model. `gen_ai.user.message`
3198-
*
3199-
* Attribute Value Type: `string` {@link GEN_AI_USER_MESSAGE_TYPE}
3200-
*
3201-
* Contains PII: true
3202-
*
3203-
* Attribute defined in OTEL: No
3204-
*
3205-
* @example "What's the weather in Paris?"
3206-
*/
3207-
export const GEN_AI_USER_MESSAGE = 'gen_ai.user.message';
3208-
3209-
/**
3210-
* Type for {@link GEN_AI_USER_MESSAGE} gen_ai.user.message
3211-
*/
3212-
export type GEN_AI_USER_MESSAGE_TYPE = string;
3213-
32143177
// Path: model/attributes/graphql/graphql__operation__name.json
32153178

32163179
/**
@@ -9024,8 +8987,6 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
90248987
[FRAMES_TOTAL]: 'integer',
90258988
[FS_ERROR]: 'string',
90268989
[GEN_AI_AGENT_NAME]: 'string',
9027-
[GEN_AI_ASSISTANT_MESSAGE]: 'string',
9028-
[GEN_AI_CHOICE]: 'string',
90298990
[GEN_AI_CONVERSATION_ID]: 'string',
90308991
[GEN_AI_COST_INPUT_TOKENS]: 'double',
90318992
[GEN_AI_COST_OUTPUT_TOKENS]: 'double',
@@ -9037,6 +8998,7 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
90378998
[GEN_AI_OUTPUT_MESSAGES]: 'string',
90388999
[GEN_AI_PIPELINE_NAME]: 'string',
90399000
[GEN_AI_PROMPT]: 'string',
9001+
[GEN_AI_PROVIDER_NAME]: 'string',
90409002
[GEN_AI_REQUEST_AVAILABLE_TOOLS]: 'string',
90419003
[GEN_AI_REQUEST_FREQUENCY_PENALTY]: 'double',
90429004
[GEN_AI_REQUEST_MAX_TOKENS]: 'integer',
@@ -9075,7 +9037,6 @@ export const ATTRIBUTE_TYPE: Record<string, AttributeType> = {
90759037
[GEN_AI_USAGE_OUTPUT_TOKENS_REASONING]: 'integer',
90769038
[GEN_AI_USAGE_PROMPT_TOKENS]: 'integer',
90779039
[GEN_AI_USAGE_TOTAL_TOKENS]: 'integer',
9078-
[GEN_AI_USER_MESSAGE]: 'string',
90799040
[GRAPHQL_OPERATION_NAME]: 'string',
90809041
[GRAPHQL_OPERATION_TYPE]: 'string',
90819042
[HTTP_CLIENT_IP]: 'string',
@@ -9455,8 +9416,6 @@ export type AttributeName =
94559416
| typeof FRAMES_TOTAL
94569417
| typeof FS_ERROR
94579418
| typeof GEN_AI_AGENT_NAME
9458-
| typeof GEN_AI_ASSISTANT_MESSAGE
9459-
| typeof GEN_AI_CHOICE
94609419
| typeof GEN_AI_CONVERSATION_ID
94619420
| typeof GEN_AI_COST_INPUT_TOKENS
94629421
| typeof GEN_AI_COST_OUTPUT_TOKENS
@@ -9468,6 +9427,7 @@ export type AttributeName =
94689427
| typeof GEN_AI_OUTPUT_MESSAGES
94699428
| typeof GEN_AI_PIPELINE_NAME
94709429
| typeof GEN_AI_PROMPT
9430+
| typeof GEN_AI_PROVIDER_NAME
94719431
| typeof GEN_AI_REQUEST_AVAILABLE_TOOLS
94729432
| typeof GEN_AI_REQUEST_FREQUENCY_PENALTY
94739433
| typeof GEN_AI_REQUEST_MAX_TOKENS
@@ -9506,7 +9466,6 @@ export type AttributeName =
95069466
| typeof GEN_AI_USAGE_OUTPUT_TOKENS_REASONING
95079467
| typeof GEN_AI_USAGE_PROMPT_TOKENS
95089468
| typeof GEN_AI_USAGE_TOTAL_TOKENS
9509-
| typeof GEN_AI_USER_MESSAGE
95109469
| typeof GRAPHQL_OPERATION_NAME
95119470
| typeof GRAPHQL_OPERATION_TYPE
95129471
| typeof HTTP_CLIENT_IP
@@ -9925,9 +9884,9 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
99259884
isInOtel: false,
99269885
example: 'openai',
99279886
deprecation: {
9928-
replacement: 'gen_ai.system',
9887+
replacement: 'gen_ai.provider.name',
99299888
},
9930-
aliases: [GEN_AI_SYSTEM],
9889+
aliases: [GEN_AI_PROVIDER_NAME, GEN_AI_SYSTEM],
99319890
},
99329891
[AI_PIPELINE_NAME]: {
99339892
brief: 'The name of the AI pipeline.',
@@ -10873,24 +10832,6 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1087310832
isInOtel: true,
1087410833
example: 'ResearchAssistant',
1087510834
},
10876-
[GEN_AI_ASSISTANT_MESSAGE]: {
10877-
brief: 'The assistant message passed to the model.',
10878-
type: 'string',
10879-
pii: {
10880-
isPii: 'true',
10881-
},
10882-
isInOtel: false,
10883-
example: 'get_weather tool call',
10884-
},
10885-
[GEN_AI_CHOICE]: {
10886-
brief: "The model's response message.",
10887-
type: 'string',
10888-
pii: {
10889-
isPii: 'true',
10890-
},
10891-
isInOtel: false,
10892-
example: 'The weather in Paris is rainy and overcast, with temperatures around 57°F',
10893-
},
1089410835
[GEN_AI_CONVERSATION_ID]: {
1089510836
brief:
1089610837
'The unique identifier for a conversation (session, thread), used to store and correlate messages within this conversation.',
@@ -11001,6 +10942,16 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1100110942
reason: 'Deprecated from OTEL, use gen_ai.input.messages with the new format instead.',
1100210943
},
1100310944
},
10945+
[GEN_AI_PROVIDER_NAME]: {
10946+
brief: 'The Generative AI provider as identified by the client or server instrumentation.',
10947+
type: 'string',
10948+
pii: {
10949+
isPii: 'maybe',
10950+
},
10951+
isInOtel: true,
10952+
example: 'openai',
10953+
aliases: [AI_MODEL_PROVIDER, GEN_AI_SYSTEM],
10954+
},
1100410955
[GEN_AI_REQUEST_AVAILABLE_TOOLS]: {
1100510956
brief: 'The available tools for the model. It has to be a stringified version of an array of objects.',
1100610957
type: 'string',
@@ -11204,7 +11155,10 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1120411155
},
1120511156
isInOtel: true,
1120611157
example: 'openai',
11207-
aliases: [AI_MODEL_PROVIDER],
11158+
deprecation: {
11159+
replacement: 'gen_ai.provider.name',
11160+
},
11161+
aliases: [AI_MODEL_PROVIDER, GEN_AI_PROVIDER_NAME],
1120811162
},
1120911163
[GEN_AI_SYSTEM_INSTRUCTIONS]: {
1121011164
brief: 'The system instructions passed to the model.',
@@ -11393,15 +11347,6 @@ export const ATTRIBUTE_METADATA: Record<AttributeName, AttributeMetadata> = {
1139311347
example: 20,
1139411348
aliases: [AI_TOTAL_TOKENS_USED],
1139511349
},
11396-
[GEN_AI_USER_MESSAGE]: {
11397-
brief: 'The user message passed to the model.',
11398-
type: 'string',
11399-
pii: {
11400-
isPii: 'true',
11401-
},
11402-
isInOtel: false,
11403-
example: "What's the weather in Paris?",
11404-
},
1140511350
[GRAPHQL_OPERATION_NAME]: {
1140611351
brief: 'The name of the operation being executed.',
1140711352
type: 'string',
@@ -14263,8 +14208,6 @@ export type Attributes = {
1426314208
[FRAMES_TOTAL]?: FRAMES_TOTAL_TYPE;
1426414209
[FS_ERROR]?: FS_ERROR_TYPE;
1426514210
[GEN_AI_AGENT_NAME]?: GEN_AI_AGENT_NAME_TYPE;
14266-
[GEN_AI_ASSISTANT_MESSAGE]?: GEN_AI_ASSISTANT_MESSAGE_TYPE;
14267-
[GEN_AI_CHOICE]?: GEN_AI_CHOICE_TYPE;
1426814211
[GEN_AI_CONVERSATION_ID]?: GEN_AI_CONVERSATION_ID_TYPE;
1426914212
[GEN_AI_COST_INPUT_TOKENS]?: GEN_AI_COST_INPUT_TOKENS_TYPE;
1427014213
[GEN_AI_COST_OUTPUT_TOKENS]?: GEN_AI_COST_OUTPUT_TOKENS_TYPE;
@@ -14276,6 +14219,7 @@ export type Attributes = {
1427614219
[GEN_AI_OUTPUT_MESSAGES]?: GEN_AI_OUTPUT_MESSAGES_TYPE;
1427714220
[GEN_AI_PIPELINE_NAME]?: GEN_AI_PIPELINE_NAME_TYPE;
1427814221
[GEN_AI_PROMPT]?: GEN_AI_PROMPT_TYPE;
14222+
[GEN_AI_PROVIDER_NAME]?: GEN_AI_PROVIDER_NAME_TYPE;
1427914223
[GEN_AI_REQUEST_AVAILABLE_TOOLS]?: GEN_AI_REQUEST_AVAILABLE_TOOLS_TYPE;
1428014224
[GEN_AI_REQUEST_FREQUENCY_PENALTY]?: GEN_AI_REQUEST_FREQUENCY_PENALTY_TYPE;
1428114225
[GEN_AI_REQUEST_MAX_TOKENS]?: GEN_AI_REQUEST_MAX_TOKENS_TYPE;
@@ -14314,7 +14258,6 @@ export type Attributes = {
1431414258
[GEN_AI_USAGE_OUTPUT_TOKENS_REASONING]?: GEN_AI_USAGE_OUTPUT_TOKENS_REASONING_TYPE;
1431514259
[GEN_AI_USAGE_PROMPT_TOKENS]?: GEN_AI_USAGE_PROMPT_TOKENS_TYPE;
1431614260
[GEN_AI_USAGE_TOTAL_TOKENS]?: GEN_AI_USAGE_TOTAL_TOKENS_TYPE;
14317-
[GEN_AI_USER_MESSAGE]?: GEN_AI_USER_MESSAGE_TYPE;
1431814261
[GRAPHQL_OPERATION_NAME]?: GRAPHQL_OPERATION_NAME_TYPE;
1431914262
[GRAPHQL_OPERATION_TYPE]?: GRAPHQL_OPERATION_TYPE_TYPE;
1432014263
[HTTP_CLIENT_IP]?: HTTP_CLIENT_IP_TYPE;

model/attributes/ai/ai__model__provider.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"example": "openai",
1010
"deprecation": {
1111
"_status": null,
12-
"replacement": "gen_ai.system"
12+
"replacement": "gen_ai.provider.name"
1313
},
14-
"alias": ["gen_ai.system"]
14+
"alias": ["gen_ai.provider.name", "gen_ai.system"]
1515
}

model/attributes/gen_ai/gen_ai__assistant__message.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

model/attributes/gen_ai/gen_ai__choice.json

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"key": "gen_ai.provider.name",
3+
"brief": "The Generative AI provider as identified by the client or server instrumentation.",
4+
"type": "string",
5+
"pii": {
6+
"key": "maybe"
7+
},
8+
"is_in_otel": true,
9+
"example": "openai",
10+
"alias": ["ai.model.provider", "gen_ai.system"]
11+
}

model/attributes/gen_ai/gen_ai__system.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@
77
},
88
"is_in_otel": true,
99
"example": "openai",
10-
"alias": ["ai.model.provider"]
10+
"deprecation": {
11+
"_status": null,
12+
"replacement": "gen_ai.provider.name"
13+
},
14+
"alias": ["ai.model.provider", "gen_ai.provider.name"]
1115
}

model/attributes/gen_ai/gen_ai__user__message.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)