AxisTelemetry.AzureMonitor 2.2.0

dotnet add package AxisTelemetry.AzureMonitor --version 2.2.0
                    
NuGet\Install-Package AxisTelemetry.AzureMonitor -Version 2.2.0
                    
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="AxisTelemetry.AzureMonitor" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AxisTelemetry.AzureMonitor" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="AxisTelemetry.AzureMonitor" />
                    
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 AxisTelemetry.AzureMonitor --version 2.2.0
                    
#r "nuget: AxisTelemetry.AzureMonitor, 2.2.0"
                    
#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 AxisTelemetry.AzureMonitor@2.2.0
                    
#: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=AxisTelemetry.AzureMonitor&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=AxisTelemetry.AzureMonitor&version=2.2.0
                    
Install as a Cake Tool

AxisTelemetry — Documentation

🌐 Português (documentação navegável)

Tracing and metrics for the Axis pipeline — IAxisTelemetry for spans, IAxisMetrics for counters and histograms, an OpenTelemetryAdapter over System.Diagnostics.ActivitySource + Meter, a NullAxisTelemetry for when you want telemetry off, and a TelemetryBehavior that wraps every mediator request with an AxisMediator.{RequestName} span plus duration / invocation / exception metrics.

using var span = telemetry.StartSpan("db.postgres.commit", AxisSpanKind.Client);
span.SetTag("db.system", "postgresql");
try
{
    await transaction.CommitAsync();
    span.SetStatus(AxisSpanStatus.Ok);
}
catch (Exception ex)
{
    span.RecordException(ex);
    throw;
}

Use this page as a map: read the trunk below (~5 min) and jump straight to the detail of the group you need — without reading hundreds of lines.


The trunk (read first)

The two interfaces in 60 seconds

public interface IAxisTelemetry
{
    IAxisSpan StartSpan(string operationName, AxisSpanKind kind = AxisSpanKind.Internal);
    string? CurrentTraceId { get; }
    string? CurrentSpanId { get; }
}

public interface IAxisMetrics
{
    void RecordHistogram(string name, double value, params KeyValuePair<string, object?>[] tags);
    void IncrementCounter(string name, long delta = 1, params KeyValuePair<string, object?>[] tags);
}

Tracing on one side, metrics on the other. The bundled OpenTelemetryAdapter implements both. → The contracts

IAxisSpan — the span you actually work with

public interface IAxisSpan : IDisposable
{
    string TraceId { get; }
    string SpanId { get; }
    IAxisSpan SetTag(string key, object? value);
    IAxisSpan SetStatus(AxisSpanStatus status, string? description = null);
    IAxisSpan RecordException(Exception exception);
    IAxisSpan AddEvent(string name, params KeyValuePair<string, object?>[] attributes);
}

Fluent — every mutator returns this. Dispose() ends the span. → Spans · IAxisSpan

TelemetryBehavior — auto-instrumentation of the mediator

Opt-in IAxisPipelineBehavior that opens an AxisMediator.{RequestName} span around every request, tags it with TraceId/JourneyId/RequestType/AxisEntityId/RequestName, times it, records:

  • axis.handler.duration_ms (histogram)
  • axis.handler.invocations (counter)
  • axis.handler.exceptions (counter, on unhandled exceptions)

→ TelemetryBehavior — automatic instrumentation

Adapters

Adapter Use when
OpenTelemetryAdapter production — emits to ActivitySource + Meter; pair with the OpenTelemetry exporter of your choice
AxisTelemetry.AzureMonitor (separate package) production on Azure — the adapter above pre-paired with the official Azure Monitor / Application Insights distro, with cost controls (sampling, log filtering) and a no-op fallback when no connection string is around
NullAxisTelemetry tests, single-process tools — every call is a no-op, every span is NullAxisSpan.Instance

→ OpenTelemetry adapter · Azure Monitor adapter · Null adapter

Installation

dotnet add package AxisTelemetry

AxisTelemetry depends directly only on AxisLogger (which brings AxisResult and AxisMediator.Contracts transitively). The OpenTelemetry adapter uses System.Diagnostics.ActivitySource and System.Diagnostics.Metrics.Meter from the BCL — no extra NuGet packages.

Exporting to Azure Monitor / Application Insights? Install the pairing package instead:

dotnet add package AxisTelemetry.AzureMonitor

→ Azure Monitor adapter

→ Full guide: Getting started


The map (jump to what you need)

Group You want to… Detail
Contracts · IAxisTelemetry / IAxisMetrics the two ports contracts.md
Spans · IAxisSpan ⭐ start, tag, record exceptions, dispose spans.md
TelemetryBehavior auto-trace every mediator request telemetry-behavior.md
OpenTelemetry adapter production tracing + metrics opentelemetry-adapter.md
Azure Monitor adapter export to Application Insights, control the bill azure-monitor.md
Null adapter turn telemetry off in tests null-adapter.md
Tag names the canonical constants tag-names.md
Why? the case for the abstraction why-axistelemetry.md
Reference every member at a glance api-reference.md

Start here: Getting started · The contracts · Why AxisTelemetry?

Fundamentals: Spans · IAxisSpan · TelemetryBehavior · OpenTelemetry adapter · Azure Monitor adapter

Reference & extras: Null adapter · Tag names · API reference


Design principles

  1. Two narrow ports, one adapter. IAxisTelemetry for traces, IAxisMetrics for metrics; the OpenTelemetry adapter implements both with one type.
  2. Vendor-neutral application code. ActivitySource and Meter live in the BCL; the application sees IAxisSpan only.
  3. Pipeline-level instrumentation. Register TelemetryBehavior and every command/query is timed, tagged and traced — no per-handler boilerplate.
  4. Null is a first-class adapter. NullAxisTelemetry.Instance lets tests and one-off tools skip the cost without changing the calling code.
  5. Tag names are constants. TelemetryTagNames.RequestName (and friends) prevent typos and make sink-side queries predictable.

License

Apache 2.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
2.2.0 140 7/21/2026
2.1.1 117 7/17/2026
2.1.0 119 7/17/2026