Intropy.Telemetry.ConsoleApp
0.1.0
dotnet add package Intropy.Telemetry.ConsoleApp --version 0.1.0
NuGet\Install-Package Intropy.Telemetry.ConsoleApp -Version 0.1.0
<PackageReference Include="Intropy.Telemetry.ConsoleApp" Version="0.1.0" />
<PackageVersion Include="Intropy.Telemetry.ConsoleApp" Version="0.1.0" />
<PackageReference Include="Intropy.Telemetry.ConsoleApp" />
paket add Intropy.Telemetry.ConsoleApp --version 0.1.0
#r "nuget: Intropy.Telemetry.ConsoleApp, 0.1.0"
#:package Intropy.Telemetry.ConsoleApp@0.1.0
#addin nuget:?package=Intropy.Telemetry.ConsoleApp&version=0.1.0
#tool nuget:?package=Intropy.Telemetry.ConsoleApp&version=0.1.0
Intropy.Telemetry
Simple OpenTelemetry configuration for .NET applications. Hook up tracing, metrics and logging with a single method call.
Why?
Setting up OpenTelemetry in .NET involves a fair amount of boilerplate: configuring resource attributes, wiring up instrumentations, adding OTLP exporters, enriching exceptions, filtering health checks, etc. This library packages all of that into a simple AddOpenTelemetry extension method so you don't have to repeat it across every project.
Packages
| Package | Description |
|---|---|
| Intropy.Telemetry.AspNetCore | For ASP.NET Core web applications |
| Intropy.Telemetry.ConsoleApp | For console applications and background workers |
Getting Started
ASP.NET Core
dotnet add package Intropy.Telemetry.AspNetCore
using Intropy.Telemetry.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenTelemetry(config =>
{
config.ServiceName = "MyService";
config.Environment = builder.Environment.EnvironmentName;
});
var app = builder.Build();
app.Run();
Console Application
dotnet add package Intropy.Telemetry.ConsoleApp
using Intropy.Telemetry.ConsoleApp;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddOpenTelemetry(config =>
{
config.ServiceName = "MyWorker";
config.Environment = "Production";
});
var serviceProvider = services.BuildServiceProvider();
using var telemetryScope = new OpenTelemetryScope(serviceProvider);
// Your application code here
What You Get Out of the Box
Tracing
- ASP.NET Core requests (ASP.NET Core package only)
- Outbound HTTP calls
- SQL Client database operations
- gRPC client calls
- Automatic exception enrichment with type, message, and stack trace
Metrics
- ASP.NET Core HTTP request metrics (ASP.NET Core package only)
- HTTP client metrics
Logging
- OTLP export of structured logs
All telemetry is exported via OTLP, configured through standard OpenTelemetry environment variables:
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
Configuration
Both packages expose the same configuration pattern via OpenTelemetryConfiguration:
| Property | Type | Required | Description |
|---|---|---|---|
ServiceName |
string |
Yes | Name of the service, e.g. "Orders.API" |
Environment |
string |
Yes | Environment name, e.g. "Production" |
ServiceNamespace |
string |
No | Namespace/organization |
ServiceVersion |
string |
No | Defaults to the entry assembly version |
ConfigureTracing |
Action<TracerProviderBuilder>? |
No | Add custom trace sources or instrumentations |
ConfigureMetrics |
Action<MeterProviderBuilder>? |
No | Add custom meters |
ConfigureLogging |
Action<LoggerProviderBuilder>? |
No | Additional logging configuration |
ConfigureResource |
Action<ResourceBuilder>? |
No | Add custom resource attributes |
The ASP.NET Core package also exposes:
| Property | Type | Required | Description |
|---|---|---|---|
FilterHttpRequest |
Func<HttpContext, bool> |
No | Filter which requests are traced. Defaults to excluding /healthz |
Full Example
builder.Services.AddOpenTelemetry(config =>
{
config.ServiceName = "Orders.API";
config.ServiceNamespace = "mycompany";
config.Environment = "Production";
config.ServiceVersion = "2.1.0";
config.ConfigureTracing = tracing =>
{
tracing.AddSource("MyCustomActivitySource");
};
config.ConfigureMetrics = metrics =>
{
metrics.AddMeter("MyCustomMeter");
};
config.ConfigureResource = resource =>
{
resource.AddAttributes([
new KeyValuePair<string, object>("team", "backend")
]);
};
});
Requirements
- .NET 10.0+
Contributing
To build and test locally:
dotnet build
dotnet test
License
This project is licensed under the MIT License.
| 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
- OpenTelemetry (>= 1.15.3)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- OpenTelemetry.Instrumentation.GrpcNetClient (>= 1.15.1-beta.1)
- OpenTelemetry.Instrumentation.Http (>= 1.15.1)
- OpenTelemetry.Instrumentation.SqlClient (>= 1.15.2)
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 |
|---|---|---|
| 0.1.0 | 57 | 4/23/2026 |