Skip to content

Commit d56e042

Browse files
authored
ref: Mark attributes removed from OTEL as removed (#119)
1 parent 844fe66 commit d56e042

File tree

11 files changed

+55
-33
lines changed

11 files changed

+55
-33
lines changed

generated/attributes/ai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ The input messages sent to the model
263263
| Exists in OpenTelemetry | No |
264264
| Example | `[{"role": "user", "message": "hello"}]` |
265265
| Deprecated | Yes, use `gen_ai.request.messages` instead |
266-
| Aliases | `gen_ai.prompt`, `gen_ai.request.messages` |
266+
| Aliases | `gen_ai.request.messages` |
267267

268268
### ai.model_id
269269

generated/attributes/gen_ai.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
- [gen_ai.operation.name](#gen_aioperationname)
1414
- [gen_ai.operation.type](#gen_aioperationtype)
1515
- [gen_ai.pipeline.name](#gen_aipipelinename)
16-
- [gen_ai.prompt](#gen_aiprompt)
1716
- [gen_ai.request.available_tools](#gen_airequestavailable_tools)
1817
- [gen_ai.request.frequency_penalty](#gen_airequestfrequency_penalty)
1918
- [gen_ai.request.max_tokens](#gen_airequestmax_tokens)
@@ -47,6 +46,7 @@
4746
- [gen_ai.usage.total_tokens](#gen_aiusagetotal_tokens)
4847
- [gen_ai.user.message](#gen_aiusermessage)
4948
- [Deprecated Attributes](#deprecated-attributes)
49+
- [gen_ai.prompt](#gen_aiprompt)
5050
- [gen_ai.usage.completion_tokens](#gen_aiusagecompletion_tokens)
5151
- [gen_ai.usage.prompt_tokens](#gen_aiusageprompt_tokens)
5252

@@ -163,18 +163,6 @@ Name of the AI pipeline or chain being executed.
163163
| Example | `Autofix Pipeline` |
164164
| Aliases | `ai.pipeline.name` |
165165

166-
### gen_ai.prompt
167-
168-
The input messages sent to the model
169-
170-
| Property | Value |
171-
| --- | --- |
172-
| Type | `string` |
173-
| Has PII | maybe |
174-
| Exists in OpenTelemetry | Yes |
175-
| Example | `[{"role": "user", "message": "hello"}]` |
176-
| Aliases | `ai.input_messages`, `gen_ai.request.messages` |
177-
178166
### gen_ai.request.available_tools
179167

180168
The available tools for the model. It has to be a stringified version of an array of objects.
@@ -219,7 +207,7 @@ The messages passed to the model. It has to be a stringified version of an array
219207
| Has PII | maybe |
220208
| Exists in OpenTelemetry | No |
221209
| Example | `[{"role": "system", "content": "Generate a random number."}, {"role": "user", "content": [{"text": "Generate a random number between 0 and 10.", "type": "text"}]}]` |
222-
| Aliases | `ai.input_messages`, `gen_ai.prompt` |
210+
| Aliases | `ai.input_messages` |
223211

224212
### gen_ai.request.model
225213

@@ -547,6 +535,19 @@ The user message passed to the model.
547535

548536
These attributes are deprecated and will be removed in a future version. Please use the recommended replacements.
549537

538+
### gen_ai.prompt
539+
540+
The input messages sent to the model
541+
542+
| Property | Value |
543+
| --- | --- |
544+
| Type | `string` |
545+
| Has PII | maybe |
546+
| Exists in OpenTelemetry | Yes |
547+
| Example | `[{"role": "user", "message": "hello"}]` |
548+
| Deprecated | Yes, no replacement at this time |
549+
| Deprecation Reason | Deprecated from OTEL, use gen_ai.input.messages with the new format instead. |
550+
550551
### gen_ai.usage.completion_tokens
551552

552553
The number of tokens used in the GenAI response (completion).

generated/attributes/net.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ Peer address of the network connection - Unix domain socket name
189189
| Has PII | false |
190190
| Exists in OpenTelemetry | Yes |
191191
| Example | `/var/my.sock` |
192-
| Deprecated | Yes, use `` instead |
193-
| Deprecation Reason | Deprecated, no replacement at this time |
192+
| Deprecated | Yes, no replacement at this time |
193+
| Deprecation Reason | Deprecated from OTEL, no replacement at this time |
194194

195195
### net.sock.peer.port
196196

javascript/sentry-conventions/src/attributes.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export type AI_GENERATION_ID_TYPE = string;
166166
*
167167
* Attribute defined in OTEL: No
168168
*
169-
* Aliases: {@link GEN_AI_PROMPT} `gen_ai.prompt`, {@link GEN_AI_REQUEST_MESSAGES} `gen_ai.request.messages`
169+
* Aliases: {@link GEN_AI_REQUEST_MESSAGES} `gen_ai.request.messages`
170170
*
171171
* @deprecated Use {@link GEN_AI_REQUEST_MESSAGES} (gen_ai.request.messages) instead
172172
* @example "[{\"role\": \"user\", \"message\": \"hello\"}]"
@@ -2214,8 +2214,7 @@ export type GEN_AI_PIPELINE_NAME_TYPE = string;
22142214
*
22152215
* Attribute defined in OTEL: Yes
22162216
*
2217-
* Aliases: {@link AI_INPUT_MESSAGES} `ai.input_messages`, {@link GEN_AI_REQUEST_MESSAGES} `gen_ai.request.messages`
2218-
*
2217+
* @deprecated - Deprecated from OTEL, use gen_ai.input.messages with the new format instead.
22192218
* @example "[{\"role\": \"user\", \"message\": \"hello\"}]"
22202219
*/
22212220
export const GEN_AI_PROMPT = 'gen_ai.prompt';
@@ -2298,7 +2297,7 @@ export type GEN_AI_REQUEST_MAX_TOKENS_TYPE = number;
22982297
*
22992298
* Attribute defined in OTEL: No
23002299
*
2301-
* Aliases: {@link AI_INPUT_MESSAGES} `ai.input_messages`, {@link GEN_AI_PROMPT} `gen_ai.prompt`
2300+
* Aliases: {@link AI_INPUT_MESSAGES} `ai.input_messages`
23022301
*
23032302
* @example "[{\"role\": \"system\", \"content\": \"Generate a random number.\"}, {\"role\": \"user\", \"content\": [{\"text\": \"Generate a random number between 0 and 10.\", \"type\": \"text\"}]}]"
23042303
*/
@@ -4557,7 +4556,7 @@ export type NET_SOCK_PEER_ADDR_TYPE = string;
45574556
*
45584557
* Attribute defined in OTEL: Yes
45594558
*
4560-
* @deprecated Use {@link } () instead - Deprecated, no replacement at this time
4559+
* @deprecated - Deprecated from OTEL, no replacement at this time
45614560
* @example "/var/my.sock"
45624561
*/
45634562
export const NET_SOCK_PEER_NAME = 'net.sock.peer.name';
@@ -6617,7 +6616,6 @@ export type Attributes = {
66176616
[GEN_AI_OPERATION_NAME]?: GEN_AI_OPERATION_NAME_TYPE;
66186617
[GEN_AI_OPERATION_TYPE]?: GEN_AI_OPERATION_TYPE_TYPE;
66196618
[GEN_AI_PIPELINE_NAME]?: GEN_AI_PIPELINE_NAME_TYPE;
6620-
[GEN_AI_PROMPT]?: GEN_AI_PROMPT_TYPE;
66216619
[GEN_AI_REQUEST_AVAILABLE_TOOLS]?: GEN_AI_REQUEST_AVAILABLE_TOOLS_TYPE;
66226620
[GEN_AI_REQUEST_FREQUENCY_PENALTY]?: GEN_AI_REQUEST_FREQUENCY_PENALTY_TYPE;
66236621
[GEN_AI_REQUEST_MAX_TOKENS]?: GEN_AI_REQUEST_MAX_TOKENS_TYPE;

model/attributes/ai/ai__input_messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"is_in_otel": false,
99
"example": "[{\"role\": \"user\", \"message\": \"hello\"}]",
10-
"alias": ["gen_ai.prompt", "gen_ai.request.messages"],
10+
"alias": ["gen_ai.request.messages"],
1111
"sdks": ["python"],
1212
"deprecation": {
1313
"_status": null,

model/attributes/gen_ai/gen_ai__prompt.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
},
88
"is_in_otel": true,
99
"example": "[{\"role\": \"user\", \"message\": \"hello\"}]",
10-
"alias": ["ai.input_messages", "gen_ai.request.messages"]
10+
"deprecation": {
11+
"_status": null,
12+
"reason": "Deprecated from OTEL, use gen_ai.input.messages with the new format instead."
13+
}
1114
}

model/attributes/gen_ai/gen_ai__request__messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
},
88
"is_in_otel": false,
99
"example": "[{\"role\": \"system\", \"content\": \"Generate a random number.\"}, {\"role\": \"user\", \"content\": [{\"text\": \"Generate a random number between 0 and 10.\", \"type\": \"text\"}]}]",
10-
"alias": ["ai.input_messages", "gen_ai.prompt"]
10+
"alias": ["ai.input_messages"]
1111
}

model/attributes/net/net__sock__peer__name.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"example": "/var/my.sock",
1010
"deprecation": {
1111
"_status": null,
12-
"replacement": "",
13-
"reason": "Deprecated, no replacement at this time"
12+
"reason": "Deprecated from OTEL, no replacement at this time"
1413
}
1514
}

scripts/generate_attribute_docs.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ function generateAttributeTable(attribute: AttributeJson): string {
3333
}
3434

3535
if (attribute.deprecation) {
36-
table += `| Deprecated | Yes, use \`${attribute.deprecation.replacement}\` instead |\n`;
36+
if (attribute.deprecation.replacement) {
37+
table += `| Deprecated | Yes, use \`${attribute.deprecation.replacement}\` instead |\n`;
38+
} else {
39+
table += '| Deprecated | Yes, no replacement at this time |\n';
40+
}
3741
if (attribute.deprecation.reason) {
3842
table += `| Deprecation Reason | ${attribute.deprecation.reason} |\n`;
3943
}

scripts/generate_attributes.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ function writeToJs(attributesDir: string, attributeFiles: string[]) {
9191

9292
// Add deprecation info if present
9393
if (deprecation) {
94-
attributesContent += ` * @deprecated Use {@link ${getConstantName(deprecation.replacement)}} (${deprecation.replacement}) instead${deprecation.reason ? ` - ${deprecation.reason}` : ''}\n`;
94+
let replacement = '';
95+
if (deprecation.replacement) {
96+
replacement = `Use {@link ${getConstantName(deprecation.replacement)}} (${deprecation.replacement}) instead`;
97+
}
98+
attributesContent += ` * @deprecated ${replacement}${deprecation.reason ? ` - ${deprecation.reason}` : ''}\n`;
9599
fullAttributeTypeMap += `\n [${constantName}]?: ${typeConstantName};`;
96100
} else {
97101
fullAttributeTypeMap += `\n [${constantName}]?: ${typeConstantName};`;

0 commit comments

Comments
 (0)