Atya.Diagnostics.Metrics 1.0.2

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

Atya.Diagnostics.Metrics

Provider-agnostic metrics helpers for .NET applications built on System.Diagnostics.Metrics.

What this package provides

  • IMeterAccessor / MeterAccessor — managed Meter wrapper with DI support
  • MetricsOptions — configuration model for service name, version, and Meter name
  • AddAtyaMetrics(...) — one-call DI registration
  • CounterExtensions / HistogramExtensions — convenience extensions for instrument creation
  • MetricTagNames / MetricTags — well-known tag name constants and tag helpers

What this package does not provide

This package intentionally does not configure:

  • OpenTelemetry SDK or exporters
  • Prometheus / OTLP / Graphite exporters
  • Serilog or any logging provider
  • ASP.NET Core middleware
  • Vendor-specific integrations

Installation

dotnet add package Atya.Diagnostics.Metrics

Basic usage

using System.Diagnostics.Metrics;
using Atya.Diagnostics.Metrics.Abstractions;
using Atya.Diagnostics.Metrics.Extensions;
using Atya.Diagnostics.Metrics.Tags;
using Microsoft.Extensions.DependencyInjection;

services.AddAtyaMetrics(options =>
{
    options.MeterName = "Orders.Service";
    options.MeterVersion = "1.0.0";
});
public class OrderProcessor
{
    private readonly Counter<long> _ordersProcessed;

    public OrderProcessor(IMeterAccessor meterAccessor)
    {
        _ordersProcessed = meterAccessor.CreateCounter<long>("orders.processed");
    }

    public void Process(int orderId)
    {
        _ordersProcessed.IncrementSuccess(MetricTags.Operation("ProcessOrder"));
        // ...
    }
}

Common tags

Use MetricTags and MetricTagValues to keep tag names and outcome values stable:

counter.IncrementFailure(
    MetricTags.Operation("ProcessOrder"),
    MetricTags.TenantId("tenant-001"));

Validation

AddAtyaMetrics validates that MeterName is not null or whitespace, and MeterAccessor validates instrument names and observable callbacks before creating instruments.

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

Showing the top 1 NuGet packages that depend on Atya.Diagnostics.Metrics:

Package Downloads
Atya.Diagnostics.Observation

Thin diagnostics composition package over logging, tracing, and metrics.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 165 7/7/2026
1.0.1 529 5/25/2026
1.0.0 236 5/23/2026