Oakrey.Applications.Telemetry
7.0.0
See the version list below for details.
dotnet add package Oakrey.Applications.Telemetry --version 7.0.0
NuGet\Install-Package Oakrey.Applications.Telemetry -Version 7.0.0
<PackageReference Include="Oakrey.Applications.Telemetry" Version="7.0.0" />
<PackageVersion Include="Oakrey.Applications.Telemetry" Version="7.0.0" />
<PackageReference Include="Oakrey.Applications.Telemetry" />
paket add Oakrey.Applications.Telemetry --version 7.0.0
#r "nuget: Oakrey.Applications.Telemetry, 7.0.0"
#:package Oakrey.Applications.Telemetry@7.0.0
#addin nuget:?package=Oakrey.Applications.Telemetry&version=7.0.0
#tool nuget:?package=Oakrey.Applications.Telemetry&version=7.0.0
Oakrey.Applications.Telemetry
A .NET 10 library providing validated OpenTelemetry TracerProvider factories for console and Seq OTLP/HTTP export.
NuGet package ID: Oakrey.Applications.Telemetry
Main features
TracerProviders.ConsoleTraceProvider(sourceName)creates a provider that exports matching activities to the console.TracerProviders.SeqTraceProvider(sourceName)creates a provider that exports matching activities to the local Seq OTLP endpoint.- Seq tracing includes
HttpClientinstrumentation. - Both providers attach OpenTelemetry service resource metadata using the validated source name.
- Provider creation is recorded through placeholder-based Oakrey logging.
- Invalid, blank, or control-character-containing source names are rejected before configuring telemetry or writing logs.
The Seq provider intentionally does not add a console exporter. This avoids duplicating telemetry and exposing span data through standard output.
Architecture
classDiagram
class TracerProviders {
+ConsoleTraceProvider(sourceName) TracerProvider
+SeqTraceProvider(sourceName) TracerProvider
-CreateBaseBuilder(sourceName) TracerProviderBuilder
-NormalizeSourceName(sourceName) string
}
Requirements
- .NET 10
- A running Seq instance on
localhost:5341when usingSeqTraceProvider
Direct dependencies
| Package | Version |
|---|---|
Oakrey.Log.Abstractions |
3.0.0 |
OpenTelemetry |
1.16.0 |
OpenTelemetry.Exporter.Console |
1.16.0 |
OpenTelemetry.Exporter.OpenTelemetryProtocol |
1.16.0 |
OpenTelemetry.Instrumentation.Http |
1.16.0 |
The unused OpenTelemetry.Instrumentation.AspNetCore dependency is not included.
Installation
dotnet add package Oakrey.Applications.Telemetry
Package Manager Console:
Install-Package Oakrey.Applications.Telemetry
Usage
Console exporter
using System.Diagnostics;
using OpenTelemetry.Trace;
using Oakrey.Applications.Telemetry;
using TracerProvider provider =
TracerProviders.ConsoleTraceProvider("MyApplication");
using ActivitySource source = new("MyApplication");
using Activity? activity = source.StartActivity("DoWork");
activity?.SetTag("result", "success");
Seq exporter
using OpenTelemetry.Trace;
using Oakrey.Applications.Telemetry;
using TracerProvider provider =
TracerProviders.SeqTraceProvider("MyApplication");
The source name passed to the provider must match the ActivitySource name whose activities should be collected.
Security and lifecycle notes
- The built-in Seq endpoint is
http://localhost:5341/ingest/otlp/v1/traces. - Plain HTTP is limited to the local loopback endpoint. Do not forward this endpoint over an untrusted network.
- Span attributes can contain sensitive application data. Review tags added by application code and HTTP instrumentation before enabling export.
TracerProviderimplementsIDisposable; dispose every provider during application shutdown so pending telemetry can be flushed.- Provider construction failures are logged without span contents and are rethrown to the caller.
- A configurable or remote Seq endpoint would require a new public API and is intentionally not introduced by this change.
License
MIT - Copyright (c) Oakrey 2016-present
| 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
- Oakrey.Log.Abstractions (>= 3.0.0)
- OpenTelemetry (>= 1.16.0)
- OpenTelemetry.Exporter.Console (>= 1.16.0)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.16.0)
- OpenTelemetry.Instrumentation.Http (>= 1.16.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Oakrey.Applications.Telemetry:
| Package | Downloads |
|---|---|
|
Oakrey.Applications.Base
A foundational .NET library for building modular WPF applications. Provides application lifecycle management, MVVM ViewModel resolution, structured logging, telemetry, and sequential or parallel service preloading with full unhandled-exception coverage. |
GitHub repositories
This package is not used by any popular GitHub repositories.