With OpenLLMetry, we aim at defining an extension of the standard OpenTelemetry Semantic Conventions for gen AI applications. We are also working closely with the otel community to standardize these conventions.

It defines additional attributes for spans to so we can log prompts, completions, token usage, etc. These attributes are reported on relevant spans when you use the OpenLLMetry SDK or the individual instrumentations.

This is a work in progress, and we welcome your feedback and contributions!

Implementations

Definitions

LLM Foundation Models

  • gen_ai.system - The vendor of the LLM (e.g. OpenAI, Anthropic, etc.)

  • gen_ai.request.model - The model requested (e.g. gpt-4, claude, etc.)

  • gen_ai.response.model - The model actually used (e.g. gpt-4-0613, etc.)

  • gen_ai.request.max_tokens - The maximum number of response tokens requested

  • gen_ai.request.temperature

  • gen_ai.request.top_p

  • gen_ai.prompt - An array of prompts as sent to the LLM model

  • gen_ai.completion - An array of completions returned from the LLM model

  • gen_ai.usage.prompt_tokens - The number of tokens used for the prompt in the request

  • gen_ai.usage.completion_tokens - The number of tokens used for the completion response

  • llm.request.type - The type of request (e.g. completion, chat, etc.)

  • llm.usage.total_tokens - The total number of tokens used

  • llm.request.functions - An array of function definitions provided to the model in the request

  • llm.frequency_penalty

  • llm.presence_penalty

  • llm.chat.stop_sequences

  • llm.user - The user ID sent with the request

  • llm.headers - The headers used for the request

Vector DBs

  • vector_db.vendor - The vendor of the Vector DB (e.g. Chroma, Pinecone, etc.)
  • vector_db.query.top_k - The top k used for the query

LLM Frameworks

  • traceloop.span.kind - One of workflow, task, agent, tool.
  • traceloop.workflow.name - The name of the parent workflow/chain associated with this span
  • traceloop.entity.name - Framework-related name for the entity (for example, in Langchain, this will be the name of the specific class that defined the chain / subchain).
  • traceloop.association.properties - Context on the request (relevant User ID, Chat ID, etc.)