AxonPush.SemanticKernel 0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package AxonPush.SemanticKernel --version 0.0.2
                    
NuGet\Install-Package AxonPush.SemanticKernel -Version 0.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AxonPush.SemanticKernel" Version="0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AxonPush.SemanticKernel" Version="0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="AxonPush.SemanticKernel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AxonPush.SemanticKernel --version 0.0.2
                    
#r "nuget: AxonPush.SemanticKernel, 0.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AxonPush.SemanticKernel@0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AxonPush.SemanticKernel&version=0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=AxonPush.SemanticKernel&version=0.0.2
                    
Install as a Cake Tool

AxonPush for .NET

AxonPush ships three NuGet packages for .NET:

Package What it does
AxonPush HTTP client for the AxonPush events API.
AxonPush.Otel OpenTelemetry span exporter that maps Activity events to AxonPush. Reusable for any .NET OpenTelemetry workload.
AxonPush.SemanticKernel One-call telemetry layer for Microsoft Semantic Kernel. Flips the GenAI diagnostic switch and wires the exporter for you.

Targets net8.0 and above.

Install

For a Semantic Kernel project:

dotnet add package AxonPush.SemanticKernel

For a generic OpenTelemetry project:

dotnet add package AxonPush.Otel

For raw publish access:

dotnet add package AxonPush

Quickstart: Semantic Kernel

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();

That single AddAxonPushTelemetry call:

  1. Flips Semantic Kernel's GenAI diagnostic switch so the kernel emits OpenTelemetry spans for chat completions, function calls, and prompt rendering.
  2. Subscribes a TracerProvider to every Microsoft.SemanticKernel.* activity source.
  3. Attaches the AxonPush span exporter, batched in the background.

Call AddAxonPushTelemetry(..., enableSensitiveData: true) to also forward prompts and completions as span events. The default is off so PII does not leave the process without an explicit opt-in.

Standalone OpenTelemetry use

using OpenTelemetry;
using OpenTelemetry.Trace;
using AxonPush.Otel;

using var tracerProvider = Sdk.CreateTracerProviderBuilder()
    .AddSource("MyApp")
    .AddAxonPushExporter(
        client => { client.ApiKey = "ak_..."; client.TenantId = "..."; },
        exporter => { exporter.ChannelId = "..."; })
    .Build();

The exporter is a plain BaseExporter<Activity>. AddAxonPushExporter wraps it in a BatchActivityExportProcessor with sensible defaults.

Environment variables

AxonPushOptions.FromEnvironment (called internally) reads:

Variable Default Notes
AXONPUSH_API_KEY required API key.
AXONPUSH_TENANT_ID required Tenant identifier.
AXONPUSH_BASE_URL https://api.axonpush.xyz Override for self-hosted deployments.
AXONPUSH_ENVIRONMENT (none) Stamped on every event for filtering.
AXONPUSH_TIMEOUT 30 Per-request timeout in seconds.
AXONPUSH_MAX_RETRIES 3 Maximum retry attempts.
AXONPUSH_FAIL_OPEN true When true, publish failures are logged and swallowed.

What spans you get from Semantic Kernel

With the GenAI switch enabled, Semantic Kernel emits spans on these activity sources:

  • Microsoft.SemanticKernel for kernel function invocations.
  • Microsoft.SemanticKernel.Connectors.OpenAI and Microsoft.SemanticKernel.Connectors.AzureOpenAI for 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 others. AxonPush stores them verbatim, so the same dashboards you build for Python LangChain or TypeScript LangGraph runs apply to your Semantic Kernel runs without changes.

Sample app

See samples/SemanticKernelChat for an end-to-end console REPL with Azure OpenAI as the default backend and an inline GetTime kernel function for function-call spans.

Fail-open behaviour

By default the client treats AxonPush as a soft dependency. If a publish fails after retries, the exception is logged at warning level and the call returns a failed PublishResult without throwing. Set AxonPushOptions.FailOpen = false (or env AXONPUSH_FAIL_OPEN=false) to surface errors to the caller.

The OpenTelemetry exporter follows the same setting. When fail-open is on, Export returns ExportResult.Success even when individual spans could not be delivered, so the OpenTelemetry SDK never propagates the failure into user code.

Release gates

client.Gates reads and writes release-gate policies and the history of gate decisions, matching the gates resource in the Python and TypeScript SDKs. Unlike telemetry publishing these are control-plane calls, so they throw AxonPushException on failure rather than failing open.

using AxonPush;
using AxonPush.Gates;

using var client = new AxonPushClient(AxonPushOptions.FromEnvironment());

await client.Gates.SavePolicyAsync(new SaveGatePolicyDto
{
    ScopeType = GatePolicyScope.Dataset,
    ScopeId = "ds_123",
    MinScore = 0.8,
    MaxFailureRate = 0.05,
});

var policies = await client.Gates.ListPoliciesAsync();
var runs = await client.Gates.ListRunsAsync(experimentId: "exp_123");

Cross-source correlation

Span payloads emitted by AxonPush.Otel use the same JSON shape as the Python (axonpush) and TypeScript (@axonpush/sdk) exporters. A Semantic Kernel chat completion span shows up in the AxonPush UI with the same schema as a LangChain run from Python or a Vercel AI middleware trace from Node. Trace and span identifiers are preserved, so spans emitted by multiple SDKs against the same workflow correlate naturally.

License

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.8 99 11/26/2026
0.0.7 97 11/25/2026
0.0.6 158 9/26/2026
0.0.5 108 9/15/2026
0.0.4 110 9/14/2026
0.0.3 108 9/11/2026
0.0.2 157 9/6/2026
0.0.1 122 9/6/2026