Anarchy.Toolkit.Core.Telemetry 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Anarchy.Toolkit.Core.Telemetry --version 1.0.0
                    
NuGet\Install-Package Anarchy.Toolkit.Core.Telemetry -Version 1.0.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="Anarchy.Toolkit.Core.Telemetry" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Anarchy.Toolkit.Core.Telemetry" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Anarchy.Toolkit.Core.Telemetry" />
                    
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 Anarchy.Toolkit.Core.Telemetry --version 1.0.0
                    
#r "nuget: Anarchy.Toolkit.Core.Telemetry, 1.0.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 Anarchy.Toolkit.Core.Telemetry@1.0.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=Anarchy.Toolkit.Core.Telemetry&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Anarchy.Toolkit.Core.Telemetry&version=1.0.0
                    
Install as a Cake Tool

Anarchy.Toolkit.Core.Telemetry

Provider-neutral telemetry built on Microsoft logging and System.Diagnostics.Metrics. The application chooses and owns the logging and metrics pipeline; no Serilog or vendor SDK is required by this package.

dotnet add package Anarchy.Toolkit.Core.Telemetry
  • ICoreTelemetry holds the two primitives: an ILogger and an IMetricRecorder. The default CoreTelemetry takes them from the application's ILoggerFactory and IMeterFactory.
  • IMetricRecorder records counters, gauges, histograms and durations (in seconds) with tags. The default MeterMetricRecorder creates each instrument once on the Anarchy.Toolkit.Telemetry meter, so OpenTelemetry collects it with AddMeter(CoreTelemetry.InstrumentationName) and no custom code.
  • AppTelemetry receives ICoreTelemetry and holds the toolkit conventions: call-site attribution (CallSite, this.CalledFrom()), standard metric names ({class_name}.{method_name}.{suffix}, see MetricSuffixes), StartTimer, RecordDuration, MonitoredActionAsync (execution count and duration), log helpers and LogContext scopes. Toolkit packages depend on AppTelemetry.

How to use it

Call services.AddCoreTelemetry(). It registers IMetricRecorder, ICoreTelemetry and AppTelemetry with TryAdd, so a registration made before it is kept, and one made after it (or with services.Replace) wins. It calls AddLogging() and AddMetrics(), which only fill in what is missing; the application's logging providers decide where logs go. Nothing is disposed by the toolkit types: instances the application registers stay owned by it, and the logger and meter created by default belong to their factories.

To bring the company's logging and metrics, derive a ModuleTelemetryBase and register the providers or a recorder in RegisterCoreTelemetry; the base then completes the registrations other toolkit modules expect. Console tools and tests that do not use DI call AppTelemetry.Create(loggerFactory, meterFactory); AppTelemetry.Null discards everything.

Notable occurrences are structured log events with a stable EventId (telemetry.Log(level, callSite, eventId, exception, template, args)) and, when the count matters, a counter. To send them to a vendor's event API (Datadog Events, New Relic custom events), add a logging provider or OpenTelemetry exporter that forwards those events, or decorate the registered IMetricRecorder; no vendor package is shipped.

For vendor backends, OpenTelemetry can collect this meter and export it using OTLP. Configure the destination according to the vendor's instructions: Datadog's Agent requires OTLP ingestion to be enabled, while its direct metrics endpoint requires HTTP and delta temporality. New Relic requires its endpoint and API key and documents its temporality recommendations. An in-memory OTLP HTTP test covers export without vendor credentials; it does not verify delivery to either vendor.

Releases

1.0.0

  • Introduced ICoreTelemetry (Microsoft logger and metric recorder), the provider-neutral IMetricRecorder with its standard .NET metrics implementation, and AppTelemetry with call-site attribution, standard metric names, timers, monitored actions, log helpers and structured log contexts.
  • Added AddCoreTelemetry(), ModuleTelemetryBase and a non-DI construction path.

Earlier releases under Anarchy.Toolkit.Core.Observability

The following versions were published under the old package name, not under Core.Telemetry.

1.1.1
  • docs(packages): identify each package's pillar and layer
  • build(packages): attribute the copyright to Leandro Melão Medeiros
  • build: relicense under Apache-2.0 and update the package metadata
1.1.0
  • build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1
1.0.6
  • docs: expand XML docblocks across all projects for the DocFX API reference
1.0.5
  • refactor(src): clean up code style across library packages
1.0.3
  • build: migrate local automation to build tooling
1.0.2
  • docs: expand package guides and release histories
1.0.1
  • Added a package-specific NuGet README.
1.0.0
  • Introduced the observer facade, structured logging context, call-site capture and measurement primitives.
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 (16)

Showing the top 5 NuGet packages that depend on Anarchy.Toolkit.Core.Telemetry:

Package Downloads
Anarchy.Toolkit.Configuration

Application configuration: settings contracts, environment and secret handling, and the provider-neutral telemetry bootstrap (ModuleTelemetry) that applications extend through dependency injection.

Anarchy.Toolkit.Testing

Shared base test toolkit: TestCaseBase, TestHelper, in-memory test telemetry (log and metric capture), API Gateway response assertions, entity fixtures, and common test extensions.

Anarchy.Toolkit.Infrastructure.Persistence.Db

Provider-agnostic relational database implementation of the persistence abstraction: connection pool, Unit of Work, resilience policy, dialect contract, repository bases, service health reports, and the transactional outbox / event store (repository contracts, records, type-id cache, and repository bases; providers supply the dialect and the embedded SQL).

Anarchy.Toolkit.Core.Events

Events: an in-process (local) publish/subscribe bus with DI-based handler dispatch, and a generic domain-event processing pipeline (event envelopes, processors, and handler bus).

Anarchy.Toolkit.Web.Ui

Blazor UI pipeline: cookie-session OAuth login, environment catalog, downstream API client base, and reusable components (notifications, modals, JSON viewer, pagination).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 0 11/21/2026
1.0.0 0 11/20/2026

Initial release.