Semantic Kernel Integration
Call instrument_semantic_kernel() after zespan.init() and every kernel invocation, plugin function call, and LLM completion is traced — Python only.
Semantic Kernel (Microsoft) is an open-source SDK for building AI agents and copilots using LLMs, plugins, and memory in Python, C#, and Java.

Getting Started
Install the SDK
Install zespan alongside semantic-kernel.
pip install zespan semantic-kernelInstrument and invoke the Kernel
Call zespan.init() then instrument_semantic_kernel() before creating your Kernel. All kernel invocations, plugin functions, and LLM calls are traced from that point.
import asyncio
from zespan.sdk import Zespan
from zespan.integrations.semantic_kernel import instrument_semantic_kernel
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
zespan = Zespan(api_key="your-api-key")
instrument_semantic_kernel()
kernel = sk.Kernel()
kernel.add_service(OpenAIChatCompletion(ai_model_id="gpt-4o"))
async def main():
result = await kernel.invoke_prompt("What is the capital of France?")
print(result)
asyncio.run(main())View traces in Zespan
Open Trace Explorer. Each kernel invocation appears as a trace with spans for every plugin function and LLM completion.
What's captured automatically
- Kernel invocations: every invoke_prompt and invoke_function call traced
- Plugin functions: each plugin function execution as a named child span
- LLM completions: token usage, model, and cost per completion
- Python only: patches Semantic Kernel's telemetry layer natively
- No OTel config needed: instrument_semantic_kernel() handles the wiring
FAQ
Do I need to configure OpenTelemetry manually?
No. instrument_semantic_kernel() patches Semantic Kernel's telemetry layer and forwards spans to Zespan. No OTel provider setup required.
Is C# Semantic Kernel supported?
The current Zespan integration is Python only. For C# Semantic Kernel, use Zespan's OTLP endpoint with the standard OTel SDK.
Start for free — 10K traces/month, no card needed
Semantic Kernel integration works on all plans including the free tier.