The Semantic Kernel integration is available for Python only.
Installation
Usage
Callinstrument_semantic_kernel() once after zespan.init(). It patches Semantic Kernel’s telemetry layer to forward spans to Zespan.
instrument_semantic_kernel().Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Trace Microsoft Semantic Kernel LLM calls and plugin executions with Zespan.
pip install zespan semantic-kernel
instrument_semantic_kernel() once after zespan.init(). It patches Semantic Kernel’s telemetry layer to forward spans to Zespan.
import asyncio
import zespan
from zespan import instrument_semantic_kernel
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
zespan.init(api_key="zsp_your_api_key_here")
instrument_semantic_kernel()
kernel = sk.Kernel()
kernel.add_service(OpenAIChatCompletion(
service_id="chat",
ai_model_id="gpt-4o",
))
async def main():
result = await kernel.invoke_prompt(
"What is the capital of France?",
service_id="chat",
)
print(result)
asyncio.run(main())
instrument_semantic_kernel().