semconv.com

gen_ai.prompt.variable

DevelopmentGenAI registrytemplate[string]as of v1.44.0

The variables supplied to the prompt template, the <key> being the variable name, the value being the variable value.

Prompt templates are parameterized with variables that are filled in at runtime. This attribute records the variable values passed to the template. The attribute name defines the variable name, and the attribute value is the variable value serialized as a string.

Examples:

- A variable user_name with value Alice SHOULD be recorded as the gen_ai.prompt.variable.user_name attribute with value "Alice". - A variable language with value French SHOULD be recorded as the gen_ai.prompt.variable.language attribute with value "French".

> [!Warning] > This attribute may contain sensitive information.

Examples

Used by

spans (5)

  • gen_ai.inference.client (opt-in)
  • mcp.client (opt-in)
  • mcp.client
  • mcp.server (opt-in)
  • mcp.server

metrics (2)

  • mcp.client.operation.duration (opt-in)
  • mcp.server.operation.duration (opt-in)

* required on that signal.

History

    Definition sourceRegistry docsJSON