Semantic Kernel
One call flips Semantic Kernel's GenAI diagnostics, subscribes a TracerProvider to every SK activity source, and attaches the axonpush exporter.
Install
dotnet add package AxonPush.SemanticKernelAdd the telemetry layer
using Microsoft.SemanticKernel;
using AxonPush.SemanticKernel;
var builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion("gpt-4o-mini", endpoint, apiKey);
builder.AddAxonPushTelemetry(
client => { client.ApiKey = "ak_..."; client.TenantId = "..."; },
exporter => { exporter.ChannelId = "..."; exporter.Environment = "production"; });
var kernel = builder.Build();Run it
Traces appear while the run is still going. There is no third step.
What that one call does
- Flips Semantic Kernel’s GenAI diagnostic switch, so the kernel emits OpenTelemetry spans for chat completions, function calls and prompt rendering. Off by default in SK.
- Subscribes a
TracerProviderto everyMicrosoft.SemanticKernel.*activity source. - Attaches the axonpush span exporter, batched in the background.
Prompts and completions
Off unless you ask for it
Prompt and completion text is not forwarded by default. Pass
enableSensitiveData: true to include them as span events:
builder.AddAxonPushTelemetry(
client => { /* … */ },
exporter => { /* … */ },
enableSensitiveData: true);The default is off so that PII does not leave the process without an explicit decision to send it.
Which spans you get
With the GenAI switch on, Semantic Kernel emits spans on:
Microsoft.SemanticKernel, kernel function invocationsMicrosoft.SemanticKernel.Connectors.OpenAIand…Connectors.AzureOpenAI, chat completion calls- Connector-specific sources for embeddings, image generation and other AI services as they ship
Spans carry the OpenTelemetry GenAI semantic-convention attributes,
gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens,
gen_ai.usage.output_tokens, gen_ai.response.finish_reasons and the rest.
axonpush stores them verbatim, so a dashboard built against Python LangChain
runs applies to Semantic Kernel runs without changes.
A working sample
samples/SemanticKernelChat in the SDK repository is an end-to-end console
REPL against Azure OpenAI, with an inline GetTime kernel function so you get
function-call spans as well as completions.