genai:semantic-conventions

Standardize AI agent instrumentation with OpenTelemetry semantic conventions for LLM observability.

292|103|Updated Mar 27, 2025
One-click install
npx skills add https://github.com/kagenti/kagenti --skill genai-semantic-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: genai:semantic-conventions
Source: https://github.com/kagenti/kagenti/tree/main/.claude/skills/genai%3Asemantic-conventions
Command: npx skills add https://github.com/kagenti/kagenti --skill genai-semantic-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opentelemetry-sdk, opentelemetry-exporter-otlp, opentelemetry-instrumentation-openai, and includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill provides a standardized way to instrument AI agents using OpenTelemetry, ensuring consistent and meaningful observability data for LLM operations.

Core Features & Use Cases

  • Standardized Attributes: Defines gen_ai.* attributes for requests, responses, and conversation context.
  • Cross-Platform Compatibility: Enables transformation of gen_ai.* attributes to OpenInference (for Phoenix) and MLflow formats.
  • Use Case: Instrument your LangChain or LlamaIndex agent to automatically log model calls, token usage, and conversation IDs to your observability backend (like Phoenix or MLflow) without custom mapping logic.

Quick Start

Use the genai:semantic-conventions skill to automatically instrument your OpenAI SDK calls with OpenTelemetry.

Frequently Asked Questions about genai:semantic-conventions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize LLM observability using OpenTelemetry semantic conventions?

You standardize LLM observability by applying OpenTelemetry semantic conventions to define `gen_ai.*` attributes for requests, responses, and conversation context. This ensures consistent logging of AI interactions across different frameworks.

Can I use semantic conventions to log OpenAI token usage without custom mapping?

Yes, you can log OpenAI token usage without custom mapping by using the `opentelemetry-instrumentation-openai` dependency. It automatically instruments OpenAI SDK calls and logs model parameters to your observability backend.

Does OpenTelemetry instrumentation work with Phoenix and MLflow observability platforms?

Yes, OpenTelemetry instrumentation works with Phoenix and MLflow by transforming `gen_ai.*` attributes into OpenInference and MLflow formats. This cross-platform compatibility eliminates the need for custom mapping logic.

What is the best way to instrument AI agents for consistent logging across frameworks?

The best way to instrument AI agents for consistent logging is using standardized OpenTelemetry semantic conventions. This facilitates tracking model calls, token usage, and conversation IDs uniformly across various AI frameworks and backends.

Do I need Python to set up OpenTelemetry semantic conventions for GenAI?

Yes, you need Python to set up OpenTelemetry semantic conventions for GenAI. The auto-instrumentation and manual span attribute setting require Python along with the `opentelemetry-sdk` and `opentelemetry-exporter-otlp` packages.

Why are my OpenTelemetry exports missing GenAI conversation context?

OpenTelemetry exports miss GenAI conversation context if you do not manually set span attributes. You must explicitly define `gen_ai.*` attributes for requests and responses to ensure meaningful observability data for LLM operations.