diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts index 6e68f75d..108e16af 100644 --- a/javascript/sentry-conventions/src/attributes.ts +++ b/javascript/sentry-conventions/src/attributes.ts @@ -3026,6 +3026,26 @@ export const GEN_AI_EMBEDDINGS_INPUT = 'gen_ai.embeddings.input'; */ export type GEN_AI_EMBEDDINGS_INPUT_TYPE = string; +// Path: model/attributes/gen_ai/gen_ai__function_id.json + +/** + * The function identifier associated with the AI operation. `gen_ai.function_id` + * + * Attribute Value Type: `string` {@link GEN_AI_FUNCTION_ID_TYPE} + * + * Contains PII: maybe + * + * Attribute defined in OTEL: No + * + * @example "my-awesome-function" + */ +export const GEN_AI_FUNCTION_ID = 'gen_ai.function_id'; + +/** + * Type for {@link GEN_AI_FUNCTION_ID} gen_ai.function_id + */ +export type GEN_AI_FUNCTION_ID_TYPE = string; + // Path: model/attributes/gen_ai/gen_ai__input__messages.json /** @@ -10360,6 +10380,7 @@ export const ATTRIBUTE_TYPE: Record = { [GEN_AI_COST_OUTPUT_TOKENS]: 'double', [GEN_AI_COST_TOTAL_TOKENS]: 'double', [GEN_AI_EMBEDDINGS_INPUT]: 'string', + [GEN_AI_FUNCTION_ID]: 'string', [GEN_AI_INPUT_MESSAGES]: 'string', [GEN_AI_OPERATION_NAME]: 'string', [GEN_AI_OPERATION_TYPE]: 'string', @@ -10848,6 +10869,7 @@ export type AttributeName = | typeof GEN_AI_COST_OUTPUT_TOKENS | typeof GEN_AI_COST_TOTAL_TOKENS | typeof GEN_AI_EMBEDDINGS_INPUT + | typeof GEN_AI_FUNCTION_ID | typeof GEN_AI_INPUT_MESSAGES | typeof GEN_AI_OPERATION_NAME | typeof GEN_AI_OPERATION_TYPE @@ -13026,6 +13048,16 @@ export const ATTRIBUTE_METADATA: Record = { example: "What's the weather in Paris?", changelog: [{ version: '0.3.1', prs: [195] }], }, + [GEN_AI_FUNCTION_ID]: { + brief: 'The function identifier associated with the AI operation.', + type: 'string', + pii: { + isPii: 'maybe', + }, + isInOtel: false, + example: 'my-awesome-function', + changelog: [{ version: 'next', prs: [308], description: 'Added gen_ai.function_id attribute' }], + }, [GEN_AI_INPUT_MESSAGES]: { brief: '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:"..."}`.', @@ -17239,6 +17271,7 @@ export type Attributes = { [GEN_AI_COST_OUTPUT_TOKENS]?: GEN_AI_COST_OUTPUT_TOKENS_TYPE; [GEN_AI_COST_TOTAL_TOKENS]?: GEN_AI_COST_TOTAL_TOKENS_TYPE; [GEN_AI_EMBEDDINGS_INPUT]?: GEN_AI_EMBEDDINGS_INPUT_TYPE; + [GEN_AI_FUNCTION_ID]?: GEN_AI_FUNCTION_ID_TYPE; [GEN_AI_INPUT_MESSAGES]?: GEN_AI_INPUT_MESSAGES_TYPE; [GEN_AI_OPERATION_NAME]?: GEN_AI_OPERATION_NAME_TYPE; [GEN_AI_OPERATION_TYPE]?: GEN_AI_OPERATION_TYPE_TYPE; diff --git a/model/attributes/gen_ai/gen_ai__function_id.json b/model/attributes/gen_ai/gen_ai__function_id.json new file mode 100644 index 00000000..d7b47ba8 --- /dev/null +++ b/model/attributes/gen_ai/gen_ai__function_id.json @@ -0,0 +1,17 @@ +{ + "key": "gen_ai.function_id", + "brief": "The function identifier associated with the AI operation.", + "type": "string", + "pii": { + "key": "maybe" + }, + "is_in_otel": false, + "example": "my-awesome-function", + "changelog": [ + { + "version": "next", + "prs": [308], + "description": "Added gen_ai.function_id attribute" + } + ] +} diff --git a/python/src/sentry_conventions/attributes.py b/python/src/sentry_conventions/attributes.py index a1602e9b..2c189bd5 100644 --- a/python/src/sentry_conventions/attributes.py +++ b/python/src/sentry_conventions/attributes.py @@ -1829,6 +1829,16 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): Example: "What's the weather in Paris?" """ + # Path: model/attributes/gen_ai/gen_ai__function_id.json + GEN_AI_FUNCTION_ID: Literal["gen_ai.function_id"] = "gen_ai.function_id" + """The function identifier associated with the AI operation. + + Type: str + Contains PII: maybe + Defined in OTEL: No + Example: "my-awesome-function" + """ + # Path: model/attributes/gen_ai/gen_ai__input__messages.json GEN_AI_INPUT_MESSAGES: Literal["gen_ai.input.messages"] = "gen_ai.input.messages" """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:"..."}`. @@ -7465,6 +7475,20 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): ChangelogEntry(version="0.3.1", prs=[195]), ], ), + "gen_ai.function_id": AttributeMetadata( + brief="The function identifier associated with the AI operation.", + type=AttributeType.STRING, + pii=PiiInfo(isPii=IsPii.MAYBE), + is_in_otel=False, + example="my-awesome-function", + changelog=[ + ChangelogEntry( + version="next", + prs=[308], + description="Added gen_ai.function_id attribute", + ), + ], + ), "gen_ai.input.messages": AttributeMetadata( brief='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:"..."}`.', type=AttributeType.STRING, @@ -11637,6 +11661,7 @@ class ATTRIBUTE_NAMES(metaclass=_AttributeNamesMeta): "gen_ai.cost.output_tokens": float, "gen_ai.cost.total_tokens": float, "gen_ai.embeddings.input": str, + "gen_ai.function_id": str, "gen_ai.input.messages": str, "gen_ai.operation.name": str, "gen_ai.operation.type": str,