diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 353a5efe..d8dc02a3 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -8286,7 +8286,7 @@ export type GEN_AI_TOOL_TYPE_TYPE = string; * Attribute defined in OTEL: Yes * Visibility: public * - * Aliases: {@link GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE} `gen_ai.usage.input_tokens.cache_write` + * Aliases: {@link GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE} `gen_ai.usage.input_tokens.cache_write`, {@link _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} `gen_ai.usage.cache_creation_input_tokens` * * @example 100 */ @@ -8297,6 +8297,30 @@ export const GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS = 'gen_ai.usage.cache_crea */ export type GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_TYPE = number; +// Path: model/attributes/gen_ai/gen_ai__usage__cache_creation_input_tokens.json + +/** + * The number of tokens written to the cache when processing the AI input (prompt). `gen_ai.usage.cache_creation_input_tokens` + * + * Attribute Value Type: `number` {@link _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} `gen_ai.usage.cache_creation.input_tokens`, {@link GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE} `gen_ai.usage.input_tokens.cache_write` + * + * @deprecated Use {@link GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} (gen_ai.usage.cache_creation.input_tokens) instead - This attribute is being deprecated in favor of gen_ai.usage.cache_creation.input_tokens. + * @example 100 + */ +export const _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS = 'gen_ai.usage.cache_creation_input_tokens'; + +/** + * Type for {@link _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} gen_ai.usage.cache_creation_input_tokens + */ +export type _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_TYPE = number; + // Path: model/attributes/gen_ai/gen_ai__usage__cache_read__input_tokens.json /** @@ -8309,7 +8333,7 @@ export type GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_TYPE = number; * Attribute defined in OTEL: Yes * Visibility: public * - * Aliases: {@link GEN_AI_USAGE_INPUT_TOKENS_CACHED} `gen_ai.usage.input_tokens.cached` + * Aliases: {@link GEN_AI_USAGE_INPUT_TOKENS_CACHED} `gen_ai.usage.input_tokens.cached`, {@link _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} `gen_ai.usage.cache_read_input_tokens` * * @example 50 */ @@ -8320,6 +8344,30 @@ export const GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS = 'gen_ai.usage.cache_read.inp */ export type GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_TYPE = number; +// Path: model/attributes/gen_ai/gen_ai__usage__cache_read_input_tokens.json + +/** + * The number of cached tokens used to process the AI input (prompt). `gen_ai.usage.cache_read_input_tokens` + * + * Attribute Value Type: `number` {@link _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_TYPE} + * + * Apply Scrubbing: manual + * + * Attribute defined in OTEL: No + * Visibility: public + * + * Aliases: {@link GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} `gen_ai.usage.cache_read.input_tokens`, {@link GEN_AI_USAGE_INPUT_TOKENS_CACHED} `gen_ai.usage.input_tokens.cached` + * + * @deprecated Use {@link GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} (gen_ai.usage.cache_read.input_tokens) instead - This attribute is being deprecated in favor of gen_ai.usage.cache_read.input_tokens. + * @example 50 + */ +export const _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS = 'gen_ai.usage.cache_read_input_tokens'; + +/** + * Type for {@link _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} gen_ai.usage.cache_read_input_tokens + */ +export type _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_TYPE = number; + // Path: model/attributes/gen_ai/gen_ai__usage__completion_tokens.json /** @@ -8379,7 +8427,7 @@ export type GEN_AI_USAGE_INPUT_TOKENS_TYPE = number; * Attribute defined in OTEL: No * Visibility: public * - * Aliases: {@link GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} `gen_ai.usage.cache_read.input_tokens` + * Aliases: {@link GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} `gen_ai.usage.cache_read.input_tokens`, {@link _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} `gen_ai.usage.cache_read_input_tokens` * * @deprecated Use {@link GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS} (gen_ai.usage.cache_read.input_tokens) instead * @example 50 @@ -8403,7 +8451,7 @@ export type GEN_AI_USAGE_INPUT_TOKENS_CACHED_TYPE = number; * Attribute defined in OTEL: No * Visibility: public * - * Aliases: {@link GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} `gen_ai.usage.cache_creation.input_tokens` + * Aliases: {@link GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} `gen_ai.usage.cache_creation.input_tokens`, {@link _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} `gen_ai.usage.cache_creation_input_tokens` * * @deprecated Use {@link GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS} (gen_ai.usage.cache_creation.input_tokens) instead * @example 100 @@ -18075,7 +18123,9 @@ export const ATTRIBUTE_TYPE: Record = { 'gen_ai.tool.output': 'string', 'gen_ai.tool.type': 'string', 'gen_ai.usage.cache_creation.input_tokens': 'integer', + 'gen_ai.usage.cache_creation_input_tokens': 'integer', 'gen_ai.usage.cache_read.input_tokens': 'integer', + 'gen_ai.usage.cache_read_input_tokens': 'integer', 'gen_ai.usage.completion_tokens': 'integer', 'gen_ai.usage.input_tokens': 'integer', 'gen_ai.usage.input_tokens.cached': 'integer', @@ -18870,7 +18920,9 @@ export type AttributeName = | typeof GEN_AI_TOOL_OUTPUT | typeof GEN_AI_TOOL_TYPE | typeof GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS + | typeof _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS | typeof GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS + | typeof _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS | typeof GEN_AI_USAGE_COMPLETION_TOKENS | typeof GEN_AI_USAGE_INPUT_TOKENS | typeof GEN_AI_USAGE_INPUT_TOKENS_CACHED @@ -24954,38 +25006,98 @@ export const ATTRIBUTE_METADATA: Record = { 'gen_ai.usage.cache_creation.input_tokens': { brief: 'The number of tokens written to the cache when processing the AI input (prompt).', type: 'integer', - keys: ['gen_ai.usage.cache_creation.input_tokens', 'gen_ai.usage.input_tokens.cache_write'], + keys: [ + 'gen_ai.usage.cache_creation.input_tokens', + 'gen_ai.usage.cache_creation_input_tokens', + 'gen_ai.usage.input_tokens.cache_write', + ], applyScrubbing: { key: 'manual', }, isInOtel: true, visibility: 'public', example: 100, - aliases: ['gen_ai.usage.input_tokens.cache_write'], + aliases: ['gen_ai.usage.input_tokens.cache_write', 'gen_ai.usage.cache_creation_input_tokens'], changelog: [ + { version: 'next', description: 'Added gen_ai.usage.cache_creation_input_tokens as an alias' }, { version: '0.11.0', prs: [418], description: 'Added gen_ai.usage.cache_creation.input_tokens attribute' }, ], additionalContext: [ 'This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.', ], }, + 'gen_ai.usage.cache_creation_input_tokens': { + brief: 'The number of tokens written to the cache when processing the AI input (prompt).', + type: 'integer', + keys: [ + 'gen_ai.usage.cache_creation.input_tokens', + 'gen_ai.usage.cache_creation_input_tokens', + 'gen_ai.usage.input_tokens.cache_write', + ], + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 100, + examples: [100], + deprecation: { + replacement: 'gen_ai.usage.cache_creation.input_tokens', + reason: 'This attribute is being deprecated in favor of gen_ai.usage.cache_creation.input_tokens.', + status: 'backfill', + }, + aliases: ['gen_ai.usage.cache_creation.input_tokens', 'gen_ai.usage.input_tokens.cache_write'], + changelog: [ + { version: 'next', prs: [582], description: 'Added gen_ai.usage.cache_creation_input_tokens attribute' }, + ], + }, 'gen_ai.usage.cache_read.input_tokens': { brief: 'The number of cached tokens used to process the AI input (prompt).', type: 'integer', - keys: ['gen_ai.usage.cache_read.input_tokens', 'gen_ai.usage.input_tokens.cached'], + keys: [ + 'gen_ai.usage.cache_read.input_tokens', + 'gen_ai.usage.cache_read_input_tokens', + 'gen_ai.usage.input_tokens.cached', + ], applyScrubbing: { key: 'manual', }, isInOtel: true, visibility: 'public', example: 50, - aliases: ['gen_ai.usage.input_tokens.cached'], - changelog: [{ version: '0.11.0', prs: [418], description: 'Added gen_ai.usage.cache_read.input_tokens attribute' }], + aliases: ['gen_ai.usage.input_tokens.cached', 'gen_ai.usage.cache_read_input_tokens'], + changelog: [ + { version: 'next', description: 'Added gen_ai.usage.cache_read_input_tokens as an alias' }, + { version: '0.11.0', prs: [418], description: 'Added gen_ai.usage.cache_read.input_tokens attribute' }, + ], additionalContext: [ 'This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.', 'This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens — it is already included.', ], }, + 'gen_ai.usage.cache_read_input_tokens': { + brief: 'The number of cached tokens used to process the AI input (prompt).', + type: 'integer', + keys: [ + 'gen_ai.usage.cache_read.input_tokens', + 'gen_ai.usage.cache_read_input_tokens', + 'gen_ai.usage.input_tokens.cached', + ], + applyScrubbing: { + key: 'manual', + }, + isInOtel: false, + visibility: 'public', + example: 50, + examples: [50], + deprecation: { + replacement: 'gen_ai.usage.cache_read.input_tokens', + reason: 'This attribute is being deprecated in favor of gen_ai.usage.cache_read.input_tokens.', + status: 'backfill', + }, + aliases: ['gen_ai.usage.cache_read.input_tokens', 'gen_ai.usage.input_tokens.cached'], + changelog: [{ version: 'next', prs: [582], description: 'Added gen_ai.usage.cache_read_input_tokens attribute' }], + }, 'gen_ai.usage.completion_tokens': { brief: 'The number of tokens used in the GenAI response (completion).', type: 'integer', @@ -25042,7 +25154,11 @@ export const ATTRIBUTE_METADATA: Record = { 'gen_ai.usage.input_tokens.cached': { brief: 'The number of cached tokens used to process the AI input (prompt).', type: 'integer', - keys: ['gen_ai.usage.cache_read.input_tokens', 'gen_ai.usage.input_tokens.cached'], + keys: [ + 'gen_ai.usage.cache_read.input_tokens', + 'gen_ai.usage.cache_read_input_tokens', + 'gen_ai.usage.input_tokens.cached', + ], applyScrubbing: { key: 'manual', }, @@ -25053,8 +25169,9 @@ export const ATTRIBUTE_METADATA: Record = { replacement: 'gen_ai.usage.cache_read.input_tokens', status: 'backfill', }, - aliases: ['gen_ai.usage.cache_read.input_tokens'], + aliases: ['gen_ai.usage.cache_read.input_tokens', 'gen_ai.usage.cache_read_input_tokens'], changelog: [ + { version: 'next', description: 'Added gen_ai.usage.cache_read_input_tokens as an alias' }, { version: '0.11.0', prs: [418], description: 'Deprecate in favor of gen_ai.usage.cache_read.input_tokens' }, { version: '0.9.0', prs: [397], description: 'Add additional_context' }, { version: '0.4.0', prs: [228] }, @@ -25068,7 +25185,11 @@ export const ATTRIBUTE_METADATA: Record = { 'gen_ai.usage.input_tokens.cache_write': { brief: 'The number of tokens written to the cache when processing the AI input (prompt).', type: 'integer', - keys: ['gen_ai.usage.cache_creation.input_tokens', 'gen_ai.usage.input_tokens.cache_write'], + keys: [ + 'gen_ai.usage.cache_creation.input_tokens', + 'gen_ai.usage.cache_creation_input_tokens', + 'gen_ai.usage.input_tokens.cache_write', + ], applyScrubbing: { key: 'manual', }, @@ -25079,8 +25200,9 @@ export const ATTRIBUTE_METADATA: Record = { replacement: 'gen_ai.usage.cache_creation.input_tokens', status: 'backfill', }, - aliases: ['gen_ai.usage.cache_creation.input_tokens'], + aliases: ['gen_ai.usage.cache_creation.input_tokens', 'gen_ai.usage.cache_creation_input_tokens'], changelog: [ + { version: 'next', description: 'Added gen_ai.usage.cache_creation_input_tokens as an alias' }, { version: '0.11.0', prs: [418], description: 'Deprecate in favor of gen_ai.usage.cache_creation.input_tokens' }, { version: '0.9.0', prs: [397], description: 'Add additional_context' }, { version: '0.4.0', prs: [217, 228] }, @@ -33732,13 +33854,41 @@ export const ATTRIBUTE_SEARCH_METADATA: Record canonicalName: 'gen_ai.usage.cache_creation.input_tokens', type: 'integer', brief: 'The number of tokens written to the cache when processing the AI input (prompt).', - deprecationChain: ['gen_ai.usage.cache_creation.input_tokens', 'gen_ai.usage.input_tokens.cache_write'], + deprecationChain: [ + 'gen_ai.usage.cache_creation.input_tokens', + 'gen_ai.usage.cache_creation_input_tokens', + 'gen_ai.usage.input_tokens.cache_write', + ], + }, + 'gen_ai.usage.cache_creation_input_tokens': { + canonicalName: 'gen_ai.usage.cache_creation.input_tokens', + type: 'integer', + brief: 'The number of tokens written to the cache when processing the AI input (prompt).', + deprecationChain: [ + 'gen_ai.usage.cache_creation.input_tokens', + 'gen_ai.usage.cache_creation_input_tokens', + 'gen_ai.usage.input_tokens.cache_write', + ], }, 'gen_ai.usage.cache_read.input_tokens': { canonicalName: 'gen_ai.usage.cache_read.input_tokens', type: 'integer', brief: 'The number of cached tokens used to process the AI input (prompt).', - deprecationChain: ['gen_ai.usage.cache_read.input_tokens', 'gen_ai.usage.input_tokens.cached'], + deprecationChain: [ + 'gen_ai.usage.cache_read.input_tokens', + 'gen_ai.usage.cache_read_input_tokens', + 'gen_ai.usage.input_tokens.cached', + ], + }, + 'gen_ai.usage.cache_read_input_tokens': { + canonicalName: 'gen_ai.usage.cache_read.input_tokens', + type: 'integer', + brief: 'The number of cached tokens used to process the AI input (prompt).', + deprecationChain: [ + 'gen_ai.usage.cache_read.input_tokens', + 'gen_ai.usage.cache_read_input_tokens', + 'gen_ai.usage.input_tokens.cached', + ], }, 'gen_ai.usage.completion_tokens': { canonicalName: 'gen_ai.usage.output_tokens', @@ -33756,13 +33906,21 @@ export const ATTRIBUTE_SEARCH_METADATA: Record canonicalName: 'gen_ai.usage.cache_creation.input_tokens', type: 'integer', brief: 'The number of tokens written to the cache when processing the AI input (prompt).', - deprecationChain: ['gen_ai.usage.cache_creation.input_tokens', 'gen_ai.usage.input_tokens.cache_write'], + deprecationChain: [ + 'gen_ai.usage.cache_creation.input_tokens', + 'gen_ai.usage.cache_creation_input_tokens', + 'gen_ai.usage.input_tokens.cache_write', + ], }, 'gen_ai.usage.input_tokens.cached': { canonicalName: 'gen_ai.usage.cache_read.input_tokens', type: 'integer', brief: 'The number of cached tokens used to process the AI input (prompt).', - deprecationChain: ['gen_ai.usage.cache_read.input_tokens', 'gen_ai.usage.input_tokens.cached'], + deprecationChain: [ + 'gen_ai.usage.cache_read.input_tokens', + 'gen_ai.usage.cache_read_input_tokens', + 'gen_ai.usage.input_tokens.cached', + ], }, 'gen_ai.usage.output_tokens': { canonicalName: 'gen_ai.usage.output_tokens', @@ -36720,7 +36878,9 @@ export type Attributes = { [GEN_AI_TOOL_OUTPUT]?: GEN_AI_TOOL_OUTPUT_TYPE; [GEN_AI_TOOL_TYPE]?: GEN_AI_TOOL_TYPE_TYPE; [GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS]?: GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_TYPE; + [_GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS]?: _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_TYPE; [GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS]?: GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_TYPE; + [_GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS]?: _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_TYPE; [GEN_AI_USAGE_COMPLETION_TOKENS]?: GEN_AI_USAGE_COMPLETION_TOKENS_TYPE; [GEN_AI_USAGE_INPUT_TOKENS]?: GEN_AI_USAGE_INPUT_TOKENS_TYPE; [GEN_AI_USAGE_INPUT_TOKENS_CACHED]?: GEN_AI_USAGE_INPUT_TOKENS_CACHED_TYPE; diff --git a/model/attributes/gen_ai/gen_ai__usage__cache_creation__input_tokens.json b/model/attributes/gen_ai/gen_ai__usage__cache_creation__input_tokens.json index 9067c0d8..4fb10c27 100644 --- a/model/attributes/gen_ai/gen_ai__usage__cache_creation__input_tokens.json +++ b/model/attributes/gen_ai/gen_ai__usage__cache_creation__input_tokens.json @@ -1,18 +1,22 @@ { "key": "gen_ai.usage.cache_creation.input_tokens", "brief": "The number of tokens written to the cache when processing the AI input (prompt).", + "additional_context": [ + "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans." + ], "type": "integer", "apply_scrubbing": { "key": "manual" }, "is_in_otel": true, - "visibility": "public", "example": 100, - "additional_context": [ - "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans." - ], - "alias": ["gen_ai.usage.input_tokens.cache_write"], + "alias": ["gen_ai.usage.input_tokens.cache_write", "gen_ai.usage.cache_creation_input_tokens"], + "visibility": "public", "changelog": [ + { + "version": "next", + "description": "Added gen_ai.usage.cache_creation_input_tokens as an alias" + }, { "version": "0.11.0", "prs": [418], diff --git a/model/attributes/gen_ai/gen_ai__usage__cache_creation_input_tokens.json b/model/attributes/gen_ai/gen_ai__usage__cache_creation_input_tokens.json new file mode 100644 index 00000000..0f5f93d6 --- /dev/null +++ b/model/attributes/gen_ai/gen_ai__usage__cache_creation_input_tokens.json @@ -0,0 +1,24 @@ +{ + "key": "gen_ai.usage.cache_creation_input_tokens", + "brief": "The number of tokens written to the cache when processing the AI input (prompt).", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "examples": [100], + "alias": ["gen_ai.usage.cache_creation.input_tokens", "gen_ai.usage.input_tokens.cache_write"], + "deprecation": { + "_status": "backfill", + "replacement": "gen_ai.usage.cache_creation.input_tokens", + "reason": "This attribute is being deprecated in favor of gen_ai.usage.cache_creation.input_tokens." + }, + "visibility": "public", + "changelog": [ + { + "version": "next", + "prs": [582], + "description": "Added gen_ai.usage.cache_creation_input_tokens attribute" + } + ] +} diff --git a/model/attributes/gen_ai/gen_ai__usage__cache_read__input_tokens.json b/model/attributes/gen_ai/gen_ai__usage__cache_read__input_tokens.json index e7fe7059..23500c4f 100644 --- a/model/attributes/gen_ai/gen_ai__usage__cache_read__input_tokens.json +++ b/model/attributes/gen_ai/gen_ai__usage__cache_read__input_tokens.json @@ -1,19 +1,23 @@ { "key": "gen_ai.usage.cache_read.input_tokens", "brief": "The number of cached tokens used to process the AI input (prompt).", + "additional_context": [ + "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.", + "This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens — it is already included." + ], "type": "integer", "apply_scrubbing": { "key": "manual" }, "is_in_otel": true, - "visibility": "public", "example": 50, - "additional_context": [ - "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.", - "This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens — it is already included." - ], - "alias": ["gen_ai.usage.input_tokens.cached"], + "alias": ["gen_ai.usage.input_tokens.cached", "gen_ai.usage.cache_read_input_tokens"], + "visibility": "public", "changelog": [ + { + "version": "next", + "description": "Added gen_ai.usage.cache_read_input_tokens as an alias" + }, { "version": "0.11.0", "prs": [418], diff --git a/model/attributes/gen_ai/gen_ai__usage__cache_read_input_tokens.json b/model/attributes/gen_ai/gen_ai__usage__cache_read_input_tokens.json new file mode 100644 index 00000000..c36d529b --- /dev/null +++ b/model/attributes/gen_ai/gen_ai__usage__cache_read_input_tokens.json @@ -0,0 +1,24 @@ +{ + "key": "gen_ai.usage.cache_read_input_tokens", + "brief": "The number of cached tokens used to process the AI input (prompt).", + "type": "integer", + "apply_scrubbing": { + "key": "manual" + }, + "is_in_otel": false, + "examples": [50], + "alias": ["gen_ai.usage.cache_read.input_tokens", "gen_ai.usage.input_tokens.cached"], + "deprecation": { + "_status": "backfill", + "replacement": "gen_ai.usage.cache_read.input_tokens", + "reason": "This attribute is being deprecated in favor of gen_ai.usage.cache_read.input_tokens." + }, + "visibility": "public", + "changelog": [ + { + "version": "next", + "prs": [582], + "description": "Added gen_ai.usage.cache_read_input_tokens attribute" + } + ] +} diff --git a/model/attributes/gen_ai/gen_ai__usage__input_tokens__cache_write.json b/model/attributes/gen_ai/gen_ai__usage__input_tokens__cache_write.json index bc9c601a..d48cb953 100644 --- a/model/attributes/gen_ai/gen_ai__usage__input_tokens__cache_write.json +++ b/model/attributes/gen_ai/gen_ai__usage__input_tokens__cache_write.json @@ -1,22 +1,26 @@ { "key": "gen_ai.usage.input_tokens.cache_write", "brief": "The number of tokens written to the cache when processing the AI input (prompt).", + "additional_context": [ + "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans." + ], "type": "integer", "apply_scrubbing": { "key": "manual" }, "is_in_otel": false, "example": 100, - "visibility": "public", - "additional_context": [ - "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans." - ], - "alias": ["gen_ai.usage.cache_creation.input_tokens"], + "alias": ["gen_ai.usage.cache_creation.input_tokens", "gen_ai.usage.cache_creation_input_tokens"], "deprecation": { "_status": "backfill", "replacement": "gen_ai.usage.cache_creation.input_tokens" }, + "visibility": "public", "changelog": [ + { + "version": "next", + "description": "Added gen_ai.usage.cache_creation_input_tokens as an alias" + }, { "version": "0.11.0", "prs": [418], diff --git a/model/attributes/gen_ai/gen_ai__usage__input_tokens__cached.json b/model/attributes/gen_ai/gen_ai__usage__input_tokens__cached.json index ddac88b5..da5296cf 100644 --- a/model/attributes/gen_ai/gen_ai__usage__input_tokens__cached.json +++ b/model/attributes/gen_ai/gen_ai__usage__input_tokens__cached.json @@ -1,23 +1,27 @@ { "key": "gen_ai.usage.input_tokens.cached", "brief": "The number of cached tokens used to process the AI input (prompt).", + "additional_context": [ + "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.", + "This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens — it is already included." + ], "type": "integer", "apply_scrubbing": { "key": "manual" }, "is_in_otel": false, "example": 50, - "visibility": "public", - "additional_context": [ - "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.", - "This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens — it is already included." - ], - "alias": ["gen_ai.usage.cache_read.input_tokens"], + "alias": ["gen_ai.usage.cache_read.input_tokens", "gen_ai.usage.cache_read_input_tokens"], "deprecation": { "_status": "backfill", "replacement": "gen_ai.usage.cache_read.input_tokens" }, + "visibility": "public", "changelog": [ + { + "version": "next", + "description": "Added gen_ai.usage.cache_read_input_tokens as an alias" + }, { "version": "0.11.0", "prs": [418], diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index 23e45706..98ddda8f 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -257,6 +257,8 @@ class _AttributeNamesMeta(type): "GEN_AI_TOOL_MESSAGE", "GEN_AI_TOOL_OUTPUT", "GEN_AI_TOOL_TYPE", + "_GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS", + "_GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS", "GEN_AI_USAGE_COMPLETION_TOKENS", "GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE", "GEN_AI_USAGE_INPUT_TOKENS_CACHED", @@ -5039,7 +5041,22 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: Yes Visibility: public - Aliases: gen_ai.usage.input_tokens.cache_write + Aliases: gen_ai.usage.input_tokens.cache_write, gen_ai.usage.cache_creation_input_tokens + Example: 100 + """ + + # Path: model/attributes/gen_ai/gen_ai__usage__cache_creation_input_tokens.json + _GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS: Literal[ + "gen_ai.usage.cache_creation_input_tokens" + ] = "gen_ai.usage.cache_creation_input_tokens" + """The number of tokens written to the cache when processing the AI input (prompt). + + Type: int + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Aliases: gen_ai.usage.cache_creation.input_tokens, gen_ai.usage.input_tokens.cache_write + DEPRECATED: Use gen_ai.usage.cache_creation.input_tokens instead - This attribute is being deprecated in favor of gen_ai.usage.cache_creation.input_tokens. Example: 100 """ @@ -5053,7 +5070,22 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: Yes Visibility: public - Aliases: gen_ai.usage.input_tokens.cached + Aliases: gen_ai.usage.input_tokens.cached, gen_ai.usage.cache_read_input_tokens + Example: 50 + """ + + # Path: model/attributes/gen_ai/gen_ai__usage__cache_read_input_tokens.json + _GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS: Literal[ + "gen_ai.usage.cache_read_input_tokens" + ] = "gen_ai.usage.cache_read_input_tokens" + """The number of cached tokens used to process the AI input (prompt). + + Type: int + Apply Scrubbing: manual + Defined in OTEL: No + Visibility: public + Aliases: gen_ai.usage.cache_read.input_tokens, gen_ai.usage.input_tokens.cached + DEPRECATED: Use gen_ai.usage.cache_read.input_tokens instead - This attribute is being deprecated in favor of gen_ai.usage.cache_read.input_tokens. Example: 50 """ @@ -5096,7 +5128,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: No Visibility: public - Aliases: gen_ai.usage.cache_creation.input_tokens + Aliases: gen_ai.usage.cache_creation.input_tokens, gen_ai.usage.cache_creation_input_tokens DEPRECATED: Use gen_ai.usage.cache_creation.input_tokens instead Example: 100 """ @@ -5111,7 +5143,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Apply Scrubbing: manual Defined in OTEL: No Visibility: public - Aliases: gen_ai.usage.cache_read.input_tokens + Aliases: gen_ai.usage.cache_read.input_tokens, gen_ai.usage.cache_read_input_tokens DEPRECATED: Use gen_ai.usage.cache_read.input_tokens instead Example: 50 """ @@ -16947,14 +16979,22 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): type=AttributeType.INTEGER, keys=( "gen_ai.usage.cache_creation.input_tokens", + "gen_ai.usage.cache_creation_input_tokens", "gen_ai.usage.input_tokens.cache_write", ), apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=True, visibility=Visibility.PUBLIC, example=100, - aliases=["gen_ai.usage.input_tokens.cache_write"], + aliases=[ + "gen_ai.usage.input_tokens.cache_write", + "gen_ai.usage.cache_creation_input_tokens", + ], changelog=[ + ChangelogEntry( + version="next", + description="Added gen_ai.usage.cache_creation_input_tokens as an alias", + ), ChangelogEntry( version="0.11.0", prs=[418], @@ -16965,19 +17005,57 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans." ], ), + "gen_ai.usage.cache_creation_input_tokens": AttributeMetadata( + brief="The number of tokens written to the cache when processing the AI input (prompt).", + type=AttributeType.INTEGER, + keys=( + "gen_ai.usage.cache_creation.input_tokens", + "gen_ai.usage.cache_creation_input_tokens", + "gen_ai.usage.input_tokens.cache_write", + ), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example=100, + examples=[100], + deprecation=DeprecationInfo( + replacement="gen_ai.usage.cache_creation.input_tokens", + reason="This attribute is being deprecated in favor of gen_ai.usage.cache_creation.input_tokens.", + status=DeprecationStatus.BACKFILL, + ), + aliases=[ + "gen_ai.usage.cache_creation.input_tokens", + "gen_ai.usage.input_tokens.cache_write", + ], + changelog=[ + ChangelogEntry( + version="next", + prs=[582], + description="Added gen_ai.usage.cache_creation_input_tokens attribute", + ), + ], + ), "gen_ai.usage.cache_read.input_tokens": AttributeMetadata( brief="The number of cached tokens used to process the AI input (prompt).", type=AttributeType.INTEGER, keys=( "gen_ai.usage.cache_read.input_tokens", + "gen_ai.usage.cache_read_input_tokens", "gen_ai.usage.input_tokens.cached", ), apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), is_in_otel=True, visibility=Visibility.PUBLIC, example=50, - aliases=["gen_ai.usage.input_tokens.cached"], + aliases=[ + "gen_ai.usage.input_tokens.cached", + "gen_ai.usage.cache_read_input_tokens", + ], changelog=[ + ChangelogEntry( + version="next", + description="Added gen_ai.usage.cache_read_input_tokens as an alias", + ), ChangelogEntry( version="0.11.0", prs=[418], @@ -16989,6 +17067,36 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens — it is already included.", ], ), + "gen_ai.usage.cache_read_input_tokens": AttributeMetadata( + brief="The number of cached tokens used to process the AI input (prompt).", + type=AttributeType.INTEGER, + keys=( + "gen_ai.usage.cache_read.input_tokens", + "gen_ai.usage.cache_read_input_tokens", + "gen_ai.usage.input_tokens.cached", + ), + apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), + is_in_otel=False, + visibility=Visibility.PUBLIC, + example=50, + examples=[50], + deprecation=DeprecationInfo( + replacement="gen_ai.usage.cache_read.input_tokens", + reason="This attribute is being deprecated in favor of gen_ai.usage.cache_read.input_tokens.", + status=DeprecationStatus.BACKFILL, + ), + aliases=[ + "gen_ai.usage.cache_read.input_tokens", + "gen_ai.usage.input_tokens.cached", + ], + changelog=[ + ChangelogEntry( + version="next", + prs=[582], + description="Added gen_ai.usage.cache_read_input_tokens attribute", + ), + ], + ), "gen_ai.usage.completion_tokens": AttributeMetadata( brief="The number of tokens used in the GenAI response (completion).", type=AttributeType.INTEGER, @@ -17054,6 +17162,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): type=AttributeType.INTEGER, keys=( "gen_ai.usage.cache_creation.input_tokens", + "gen_ai.usage.cache_creation_input_tokens", "gen_ai.usage.input_tokens.cache_write", ), apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), @@ -17064,8 +17173,15 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): replacement="gen_ai.usage.cache_creation.input_tokens", status=DeprecationStatus.BACKFILL, ), - aliases=["gen_ai.usage.cache_creation.input_tokens"], + aliases=[ + "gen_ai.usage.cache_creation.input_tokens", + "gen_ai.usage.cache_creation_input_tokens", + ], changelog=[ + ChangelogEntry( + version="next", + description="Added gen_ai.usage.cache_creation_input_tokens as an alias", + ), ChangelogEntry( version="0.11.0", prs=[418], @@ -17085,6 +17201,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): type=AttributeType.INTEGER, keys=( "gen_ai.usage.cache_read.input_tokens", + "gen_ai.usage.cache_read_input_tokens", "gen_ai.usage.input_tokens.cached", ), apply_scrubbing=ApplyScrubbingInfo(key=ApplyScrubbing.MANUAL), @@ -17095,8 +17212,15 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): replacement="gen_ai.usage.cache_read.input_tokens", status=DeprecationStatus.BACKFILL, ), - aliases=["gen_ai.usage.cache_read.input_tokens"], + aliases=[ + "gen_ai.usage.cache_read.input_tokens", + "gen_ai.usage.cache_read_input_tokens", + ], changelog=[ + ChangelogEntry( + version="next", + description="Added gen_ai.usage.cache_read_input_tokens as an alias", + ), ChangelogEntry( version="0.11.0", prs=[418], @@ -24576,7 +24700,9 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "gen_ai.tool.output": str, "gen_ai.tool.type": str, "gen_ai.usage.cache_creation.input_tokens": int, + "gen_ai.usage.cache_creation_input_tokens": int, "gen_ai.usage.cache_read.input_tokens": int, + "gen_ai.usage.cache_read_input_tokens": int, "gen_ai.usage.completion_tokens": int, "gen_ai.usage.input_tokens": int, "gen_ai.usage.input_tokens.cache_write": int,