Icomm.Telemetry.AspNetCore (0.1.6.1)
Published 2025-05-05 22:28:10 +07:00 by Long Nguyễn Đình - Core
Installation
dotnet nuget add source --name ic --username your_username --password your_token https://git.icomm.vn/api/packages/ic/nuget/index.jsondotnet add package --source ic --version 0.1.6.1 Icomm.Telemetry.AspNetCoreAbout this package
OpenTelemetry
Getting started
dotnet add package Icomm.Telemetry.AspNetCore
Register DI:
using OpenTelemetry.Trace;
services.AddIcOpenTelemetry(
configuration,
configure: options =>
{
options.TracingSources = options.MetricSources = new[]
{
// Tracer.OpenTelemetry.Fody
Tracer.OpenTelemetry.ActivitySourceConstants.Name
};
options.AddAspNetCore();
// Extra Tracing
options.Tracing += b =>
{
};
}
);
Extra Tracing
SqlClient
Nuget:
dotnet add package OpenTelemetry.Instrumentation.SqlClient --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient
configuration.ConfigureIfEnable(
config => b.AddSqlClientInstrumentation(opt => config.Bind(opt)),
"OpenTelemetry",
"Instrumentation",
"SqlClient"
);
GrpcCore
Nuget:
dotnet add package OpenTelemetry.Instrumentation.GrpcCore --prerelease
Code:
//// https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.GrpcCore
//configuration.ConfigureIfEnable(config => b.AddGrpcCoreInstrumentation(), "OpenTelemetry", "Instrumentation", "GrpcCore");
GrpcClient
Nuget:
dotnet add package OpenTelemetry.Instrumentation.GrpcNetClient --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient
configuration.ConfigureIfEnable(
config =>
b.AddGrpcClientInstrumentation(opt =>
{
config.Bind(opt);
opt.EnrichWithHttpRequestMessage = options!.Enrich;
opt.EnrichWithHttpResponseMessage = options!.Enrich;
}),
"OpenTelemetry",
"Instrumentation",
"GrpcClient"
);
ElasticsearchClient
Nuget:
dotnet add package OpenTelemetry.Instrumentation.ElasticsearchClient --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.ElasticsearchClient
configuration.ConfigureIfEnable(config => b.AddElasticsearchClientInstrumentation(opt => config.Bind(opt)), "OpenTelemetry", "Instrumentation", "ElasticsearchClient");
EntityFrameworkCore
Nuget:
dotnet add package OpenTelemetry.Instrumentation.EntityFrameworkCore --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.EntityFrameworkCore
configuration.ConfigureIfEnable(
config => b.AddEntityFrameworkCoreInstrumentation(opt => config.Bind(opt)),
"OpenTelemetry",
"Instrumentation",
"EntityFrameworkCore"
);
Hangfire
Nuget:
dotnet add package OpenTelemetry.Instrumentation.Hangfire --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Hangfire
configuration.ConfigureIfEnable(config => b.AddHangfireInstrumentation(), "OpenTelemetry", "Instrumentation", "Hangfire");
Quartz
Nuget:
dotnet add package OpenTelemetry.Instrumentation.Quartz --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.Quartz
configuration.ConfigureIfEnable(config => b.AddQuartzInstrumentation(opt => config.Bind(opt)), "OpenTelemetry", "Instrumentation", "Quartz");
Redis
Nuget:
dotnet add package OpenTelemetry.Instrumentation.StackExchangeRedis --prerelease
Code:
// https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Instrumentation.StackExchangeRedis
configuration.ConfigureIfEnable(config => b.AddRedisInstrumentation(configure: opt => config.Bind(opt)), "OpenTelemetry", "Instrumentation", "Redis");
Dependencies
Details
2025-05-05 22:28:10 +07:00
Assets (2)
Versions (14)
View all
NuGet
34
long.nguyen
12 KiB