Anarchy.Toolkit.Core.Telemetry
1.0.1
dotnet add package Anarchy.Toolkit.Core.Telemetry --version 1.0.1
NuGet\Install-Package Anarchy.Toolkit.Core.Telemetry -Version 1.0.1
<PackageReference Include="Anarchy.Toolkit.Core.Telemetry" Version="1.0.1" />
<PackageVersion Include="Anarchy.Toolkit.Core.Telemetry" Version="1.0.1" />
<PackageReference Include="Anarchy.Toolkit.Core.Telemetry" />
paket add Anarchy.Toolkit.Core.Telemetry --version 1.0.1
#r "nuget: Anarchy.Toolkit.Core.Telemetry, 1.0.1"
#:package Anarchy.Toolkit.Core.Telemetry@1.0.1
#addin nuget:?package=Anarchy.Toolkit.Core.Telemetry&version=1.0.1
#tool nuget:?package=Anarchy.Toolkit.Core.Telemetry&version=1.0.1
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
ICoreTelemetryholds the two primitives: anILoggerand anIMetricRecorder. The defaultCoreTelemetrytakes them from the application'sILoggerFactoryandIMeterFactory.IMetricRecorderrecords counters, gauges, histograms and durations (in seconds) with tags. The defaultMeterMetricRecordercreates each instrument once on theAnarchy.Toolkit.Telemetrymeter, so OpenTelemetry collects it withAddMeter(CoreTelemetry.InstrumentationName)and no custom code.AppTelemetryreceivesICoreTelemetryand holds the toolkit conventions: call-site attribution (CallSite,this.CalledFrom()), standard metric names ({class_name}.{method_name}.{suffix}, seeMetricSuffixes),StartTimer,RecordDuration,MonitoredActionAsync(execution count and duration), log helpers andLogContextscopes. Toolkit packages depend onAppTelemetry.
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
See the release notes for the complete release history.
| Product | Versions 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. |
-
net10.0
- Anarchy.Toolkit.Core (>= 2.0.1)
- Humanizer (>= 3.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Newtonsoft.Json (>= 13.0.4)
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.
## Releases
### 1.0.1
- chore(build): Format package release notes property
### 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.