.NET SDK
Event publishing, OpenTelemetry and Semantic Kernel metadata telemetry for .NET 8 and above.
axonpush has three .NET packages, targeting .NET 8 and above.
| Package | Purpose |
|---|---|
AxonPush | API client for publishing events |
AxonPush.Otel | OpenTelemetry span exporter and GenAI telemetry helpers |
AxonPush.SemanticKernel | Passive Semantic Kernel telemetry integration |
dotnet add package AxonPush
# Choose supporting telemetry for the stack already in use:
dotnet add package AxonPush.Otel
# Or:
dotnet add package AxonPush.SemanticKernelThese pages describe the published 0.0.6 packages. Configure
AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL,
AXONPUSH_CHANNEL_ID and AXONPUSH_ENVIRONMENT through existing
secret/configuration storage. Exporter content capture defaults to
metadata-only; Semantic Kernel sensitive-data capture defaults off.
Publish events
AxonPushClient exposes one resource, Events, with PublishAsync. It posts
to POST /event and honours the client’s fail-open setting: a failure after
retries is logged and returned as a PublishResult with Success = false
instead of throwing.
using AxonPush;
using AxonPush.Events;
await using var client = new AxonPushClient(AxonPushOptions.FromEnvironment());
var result = await client.Events.PublishAsync(new PublishRequest
{
Identifier = "ticket.escalated",
Payload = new { priority = "high", queue = "billing" },
ChannelId = Environment.GetEnvironmentVariable("AXONPUSH_CHANNEL_ID")!,
AgentId = "triage-bot",
EventType = EventType.AgentMessage,
});
if (!result.Success)
{
Console.WriteLine($"publish failed after {result.Attempts} attempts: {result.ErrorMessage}");
}AxonPushOptions.FromEnvironment() reads AXONPUSH_API_KEY,
AXONPUSH_TENANT_ID, AXONPUSH_CHANNEL_ID, AXONPUSH_BASE_URL (default
https://api.axonpush.xyz), AXONPUSH_ENVIRONMENT, AXONPUSH_TIMEOUT
(seconds, default 30), AXONPUSH_MAX_RETRIES (default 3) and
AXONPUSH_FAIL_OPEN (default true). The environment is sent as the
X-Axonpush-Environment header. Set it on the options rather than on
PublishRequest.Environment, which the current API does not accept in the
request body.
The published .NET package does not include the workspace, observation or
activity resources, or the Observe, Identify and Group helpers. Send
observations and profile traits over HTTP; see
Workspaces and the
API reference.
Supporting telemetry
Attach to an existing application tracer provider where possible. Metadata-only capture preserves model/token/tool/timing metadata and excludes content. Apply a source-specific allowlist before buffering; do not forward prompts, messages, arguments/results, documents, contacts, credentials or raw exception text.
Observability is a soft dependency: a fail-open result does not prove delivery. Export outside business transactions, with independent retry/gap health and bounded shutdown/flush behavior appropriate to the host. Keep routing, authorization, responses and business side effects unchanged.
See OpenTelemetry, Semantic Kernel, Telemetry and API reference.
BullMQ
Swap the in-memory publish queue for a Redis-backed BullMQ queue, so log and span events survive restarts and retry on transient failures.
Semantic Kernel
One call flips Semantic Kernel's GenAI diagnostics, subscribes a TracerProvider to every SK activity source, and attaches the axonpush exporter.