![]() |
VOOZH | about |
Requires NuGet 5.0.0 or higher.
dotnet add package Genocs.Telemetry --version 9.0.0
NuGet\Install-Package Genocs.Telemetry -Version 9.0.0
<PackageReference Include="Genocs.Telemetry" Version="9.0.0" />
<PackageVersion Include="Genocs.Telemetry" Version="9.0.0" />Directory.Packages.props
<PackageReference Include="Genocs.Telemetry" />Project file
paket add Genocs.Telemetry --version 9.0.0
#r "nuget: Genocs.Telemetry, 9.0.0"
#:package Genocs.Telemetry@9.0.0
#addin nuget:?package=Genocs.Telemetry&version=9.0.0Install as a Cake Addin
#tool nuget:?package=Genocs.Telemetry&version=9.0.0Install as a Cake Tool
OpenTelemetry integration helpers for traces and metrics. Supports net10.0, net9.0, and net8.0.
dotnet add package Genocs.Telemetry
Use this package to configure OpenTelemetry traces and metrics in Genocs services.
Service registration:
using Genocs.Telemetry;
genocs.AddTelemetry();
Configuration example:
{
"app": {
"service": "My Service"
},
"telemetry": {
"enabled": true,
"sqlClient": {
"enabled": true,
"enableStatementText": false
},
"exporter": {
"enabled": true,
"otlpEndpoint": "http://localhost:4317",
"protocol": "Grpc",
"enableTracing": true,
"enableMetrics": true
}
}
}
telemetry.sqlClient.enabled controls whether SQL client tracing instrumentation is registered.
When omitted, it defaults to true for backward compatibility.
telemetry.sqlClient.enableStatementText is disabled by default. Enable it only when SQL query text (db.query.text/db.statement) collection is explicitly required.
If telemetry.exporter.enabled is true and telemetry.exporter.otlpEndpoint is missing or invalid, OTLP exporter registration is skipped and a warning is emitted. Startup remains safe and traces/metrics continue with the remaining configured exporters.
Exception enrichment now applies bounded message handling for span status and exception message tags.
1024 characters....(truncated).This preserves diagnostic signal while avoiding oversized payload pressure in telemetry backends.
Genocs.Telemetry prefers route templates for http.route (for example, orders/{orderId}).
When route metadata is unavailable, the default fallback is a bounded constant:
/_unmatchedThis avoids high-cardinality tags from raw request paths.
Optional fallback behavior:
telemetry.enableRoutePathFallback: opt-in to request-path fallbacktelemetry.normalizeRoutePathFallback: when enabled (default), path fallback normalizes identifier-like segments (such as numeric IDs and GUIDs)Example:
{
"telemetry": {
"enabled": true,
"enableRoutePathFallback": true,
"normalizeRoutePathFallback": true
}
}
Genocs.Telemetry now uses a bounded default source set to reduce unintended trace collection.
Default registered sources:
Genocs.SagaGenocs.Messaging.RabbitMQGenocs.Messaging.AzureServiceBusFuture source integration is configuration-driven via telemetry.activitySources.
Wildcard collection is opt-in via telemetry.enableWildcardActivitySources and should be used only when broad source capture is explicitly required.
Example:
{
"telemetry": {
"enabled": true,
"enableWildcardActivitySources": false,
"activitySources": [
"MyCompany.Payments",
"MyCompany.Inventory"
]
}
}
Genocs.Telemetry registers tracing and metrics pipelines in both builder flows:
WebApplicationBuilder hostsIServiceCollection + IConfiguration hostsOpenTelemetry log exporters are not configured by Genocs.Telemetry in either host mode.
If you need OTLP or Azure log export, configure it through Genocs.Logging.
telemetry.exporter batch processor settings are validated before wiring exporters.
maxQueueSize: supported range 512-65536, fallback 2048scheduledDelayMilliseconds: supported range 100-60000, fallback 5000exporterTimeoutMilliseconds: supported range 1000-120000, fallback 30000maxExportBatchSize: supported range 1-1024, fallback 512If maxExportBatchSize resolves to a value greater than maxQueueSize, it is reduced to a safe fallback and a warning is emitted.
For high-throughput workloads, prefer increasing maxQueueSize first, then tune maxExportBatchSize and timeouts incrementally while observing exporter backpressure and dropped-span metrics.
Genocs.Telemetry does not configure OpenTelemetry log exporters.
Genocs.Telemetry for traces and metrics.Genocs.Logging for log export ownership (OTLP, Azure Application Insights, Seq, Loki, Elasticsearch, file, console).This avoids duplicate log ingestion when both packages target the same backend.
Genocs.Telemetry allows multiple exporters per signal. This is valid, but should be intentional because it increases export volume and backend cost.
Recommended profiles:
Signal-level guidance:
Genocs.Telemetry; log export remains owned by Genocs.Logging.Overlap warning when Genocs.Logging is enabled:
Genocs.Logging exports logs to OTLP or Azure, do not add any telemetry-side log export assumptions in runbooks or config templates.telemetry as trace/metric routing only.{
"logger": {
"azure": {
"enabled": true,
"connectionString": "InstrumentationKey=<<key>>;IngestionEndpoint=https://<<region>>.in.applicationinsights.azure.com/"
},
"otlpEndpoint": null
},
"telemetry": {
"enabled": true,
"exporter": {
"enabled": false
},
"azure": {
"enabled": true,
"enableTracing": true,
"enableMetrics": true,
"connectionString": "InstrumentationKey=<<key>>;IngestionEndpoint=https://<<region>>.in.applicationinsights.azure.com/"
},
"console": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false
}
}
}
Jaeger ingestion is supported via OTLP collector endpoints. Genocs.Telemetry uses OpenTelemetry.Exporter.OpenTelemetryProtocol for this flow and does not require a direct Jaeger exporter package.
Use one of the Jaeger collector OTLP endpoints:
http://localhost:4317 with "protocol": "Grpc"http://localhost:4318 with "protocol": "HttpProtobuf"{
"logger": {
"otlpEndpoint": null,
"azure": {
"enabled": false
}
},
"telemetry": {
"enabled": true,
"exporter": {
"enabled": true,
"otlpEndpoint": "http://localhost:4317",
"protocol": "Grpc",
"enableTracing": true,
"enableMetrics": false
},
"azure": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false
},
"console": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false
}
}
}
Use this only for controlled migration or backend comparison windows.
{
"logger": {
"otlpEndpoint": "http://localhost:4317",
"azure": {
"enabled": false
}
},
"telemetry": {
"enabled": true,
"exporter": {
"enabled": true,
"otlpEndpoint": "http://localhost:4317",
"protocol": "Grpc",
"enableTracing": true,
"enableMetrics": true
},
"azure": {
"enabled": true,
"enableTracing": true,
"enableMetrics": true,
"connectionString": "InstrumentationKey=<<key>>;IngestionEndpoint=https://<<region>>.in.applicationinsights.azure.com/"
},
"console": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false
}
}
}
When this profile is active, expect duplicate traces and metrics across backends by design.
When trace exporters are effectively disabled, Genocs.Telemetry keeps instrumentation registration deterministic while reducing enrichment overhead:
Use this profile when instrumentation is kept on for compatibility, but trace export is intentionally disabled.
{
"telemetry": {
"enabled": true,
"exporter": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false
},
"console": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false
},
"azure": {
"enabled": false,
"enableTracing": false,
"enableMetrics": false,
"connectionString": ""
}
}
}
Prometheus is exposed as a built-in plug-in on top of the OpenTelemetry MeterProvider. The
formerly-separate Genocs.Metrics package is no longer required — installing
Genocs.Telemetry and enabling the telemetry.prometheus sub-section is enough.
When enabled, AddTelemetry():
OpenTelemetry.Exporter.Prometheus.AspNetCore exporter to the meter provider.UsePrometheus().Configuration:
{
"telemetry": {
"enabled": true,
"prometheus": {
"enabled": true,
"endpoint": "/metrics",
"apiKey": null,
"allowedHosts": []
}
}
}
Settings:
enabled: master switch for the Prometheus plug-in. Defaults to false.endpoint: scraping path. Defaults to /metrics. Always normalized to start with /.apiKey: optional API key. When set, callers must pass ?apiKey=<value> on the scraping endpoint.allowedHosts: optional list of allowed hosts (or x-forwarded-for values). When set, only matching callers may scrape. If both apiKey and allowedHosts are empty, the endpoint is open to any caller.Pipeline wiring:
using Genocs.Telemetry;
var app = builder.Build();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
// Auth-gate middleware (no-op when telemetry.prometheus.enabled is false).
app.UsePrometheus();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
// Map the Prometheus scraping endpoint (no-op when telemetry.prometheus.enabled is false).
endpoints.MapPrometheus();
});
UsePrometheus() and MapPrometheus() are safe to call unconditionally: when the plug-in is
disabled, both calls are no-ops.
AddTelemetryUsePrometheus (extension on IApplicationBuilder)MapPrometheus (extension on IEndpointRouteBuilder)Run this command before publishing telemetry changes to verify analyzer/nullability baseline remains warning-clean:
dotnet build src/Genocs.Telemetry/Genocs.Telemetry.csproj -c Debug --nologo
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0 | 91 | 5/21/2026 |
| 9.0.0-beta009 | 94 | 5/11/2026 |
| 9.0.0-beta008 | 147 | 5/2/2026 |
| 9.0.0-beta007 | 65 | 4/29/2026 |
| 9.0.0-beta006 | 62 | 4/27/2026 |
| 9.0.0-beta005 | 79 | 4/26/2026 |
| 9.0.0-beta004 | 70 | 4/18/2026 |
| 9.0.0-beta003 | 108 | 4/5/2026 |
| 9.0.0-beta002 | 95 | 3/17/2026 |
| 9.0.0-beta001 | 109 | 2/28/2026 |
The change log and breaking changes are listed here.
https://github.com/Genocs/genocs-library/releases