Gen AI

Gen AI Attributes

This document defines the attributes used to describe telemetry in the context of LLM (Large Language Models) requests and responses.

AttributeTypeDescriptionExamplesStability
gen_ai.completionstringThe full response received from the LLM. [1][{'role': 'assistant', 'content': 'The capital of France is Paris.'}]Experimental
gen_ai.promptstringThe full prompt sent to an LLM. [2][{'role': 'user', 'content': 'What is the capital of France?'}]Experimental
gen_ai.request.max_tokensintThe maximum number of tokens the LLM generates for a request.100Experimental
gen_ai.request.modelstringThe name of the LLM a request is being made to.gpt-4Experimental
gen_ai.request.temperaturedoubleThe temperature setting for the LLM request.0.0Experimental
gen_ai.request.top_pdoubleThe top_p sampling setting for the LLM request.1.0Experimental
gen_ai.response.finish_reasonsstring[]Array of reasons the model stopped generating tokens, corresponding to each generation received.stopExperimental
gen_ai.response.idstringThe unique identifier for the completion.chatcmpl-123Experimental
gen_ai.response.modelstringThe name of the LLM a response was generated from.gpt-4-0613Experimental
gen_ai.systemstringThe Generative AI product as identified by the client instrumentation. [3]openaiExperimental
gen_ai.usage.completion_tokensintThe number of tokens used in the LLM response (completion).180Experimental
gen_ai.usage.prompt_tokensintThe number of tokens used in the LLM prompt.100Experimental

[1]: It’s RECOMMENDED to format completions as JSON string matching OpenAI messages format

[2]: It’s RECOMMENDED to format prompts as JSON string matching OpenAI messages format

[3]: The actual GenAI product may differ from the one identified by the client. For example, when using OpenAI client libraries to communicate with Mistral, the gen_ai.system is set to openai based on the instrumentation’s best knowledge.

gen_ai.system has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

ValueDescriptionStability
openaiOpenAIExperimental