Add HoneyHive observability to your Semantic Kernel applications
Semantic Kernel is Microsoft’s open-source SDK for building AI agents and multi-agent systems. It provides a model-agnostic framework with plugins, function calling, and enterprise-ready orchestration.HoneyHive works best with Semantic Kernel when you combine SK’s native OpenTelemetry diagnostics with a provider-specific instrumentor. SK-native spans preserve agent names and orchestration structure, while the provider instrumentor adds richer model input/output payloads.
Recommended setup. Enable SK’s native diagnostics before imports, initialize HoneyHive, then instrument your model provider so model events include full chat history and responses.
The examples on this page use OpenAIChatCompletion, so they use OpenAIInstrumentor. If your Semantic Kernel app uses Anthropic, Bedrock, Gemini, or another provider, use the matching provider openinference instrumentor when one exists.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.
Enable SK diagnostics first - Environment variables must be set before any imports:
import os# ✅ Correct - set env vars firstos.environ["SEMANTICKERNEL_EXPERIMENTAL_GENAI_ENABLE_OTEL_DIAGNOSTICS"] = "true"os.environ["SEMANTICKERNEL_EXPERIMENTAL_GENAI_ENABLE_OTEL_DIAGNOSTICS_SENSITIVE"] = "true"from honeyhive import HoneyHiveTracertracer = HoneyHiveTracer.init(project="your-project")from semantic_kernel.agents import ChatCompletionAgent# ❌ Wrong - env vars set after importsfrom semantic_kernel.agents import ChatCompletionAgentos.environ["SEMANTICKERNEL_EXPERIMENTAL_GENAI_ENABLE_OTEL_DIAGNOSTICS"] = "true"
Check environment variables - Ensure HH_API_KEY and HH_PROJECT are set
Verify OpenAI credentials - Ensure OPENAI_API_KEY is configured
Instrument your provider - Use the matching provider instrumentor if you need model events with full inputs and outputs in HoneyHive. This page uses OpenAIInstrumentor because the examples use OpenAIChatCompletion.
Enable sensitive diagnostics and the matching provider instrumentor to capture full message content on model events. This OpenAI example uses OpenAIInstrumentor: