![]() |
VOOZH | about |
dotnet add package OpenTelemetry.Exporter.Geneva --version 1.15.2
NuGet\Install-Package OpenTelemetry.Exporter.Geneva -Version 1.15.2
<PackageReference Include="OpenTelemetry.Exporter.Geneva" Version="1.15.2" />
<PackageVersion Include="OpenTelemetry.Exporter.Geneva" Version="1.15.2" />Directory.Packages.props
<PackageReference Include="OpenTelemetry.Exporter.Geneva" />Project file
paket add OpenTelemetry.Exporter.Geneva --version 1.15.2
#r "nuget: OpenTelemetry.Exporter.Geneva, 1.15.2"
#:package OpenTelemetry.Exporter.Geneva@1.15.2
#addin nuget:?package=OpenTelemetry.Exporter.Geneva&version=1.15.2Install as a Cake Addin
#tool nuget:?package=OpenTelemetry.Exporter.Geneva&version=1.15.2Install as a Cake Tool
| Status | |
|---|---|
| Stability | Stable |
| Code Owners | @rajkumar-rangaraj, @xiang17 |
👁 NuGet version badge
👁 NuGet download count badge
👁 codecov.io
The Geneva Exporter exports telemetry to Event Tracing for Windows (ETW) or to a Unix Domain Socket (UDS) on the local machine.
dotnet add package OpenTelemetry.Exporter.Geneva
The three types of telemetry are handled separately in OpenTelemetry. Therefore, each type of telemetry must be enabled separately.
This snippet shows how to configure the Geneva Exporter for Logs
using var loggerFactory = LoggerFactory.Create(loggingBuilder => loggingBuilder
.AddOpenTelemetry(openTelemetryLoggerOptions =>
{
openTelemetryLoggerOptions.AddGenevaLogExporter(genevaExporterOptions =>
{
genevaExporterOptions.ConnectionString = "EtwSession=OpenTelemetry";
});
}));
The above code must be in application startup. In case of ASP.NET Core
applications, this should be in ConfigureServices of Startup class.
For ASP.NET applications, this should be in Global.aspx.cs.
Since OpenTelemetry .NET SDK is a
LoggingProvider,
use the built-in mechanism to apply Log
filtering.
This filtering lets you control the Logs that are sent to each registered
provider, including the OpenTelemetry provider. OpenTelemetry is the
alias
for OpenTelemetryLoggerProvider, that may be used when configuring filtering
rules.
Some application types (e.g. ASP.NET
Core)
have default logging settings. Please review them to make sure
OpenTelemetryLoggingProvider is configured to receive Logs of appropriate
levels and category.
An experimental feature flag is available to opt-into enriching logs with Azure
Front Door (AFD) Correlation IDs when present in the RuntimeContext. This
helps track requests as they flow through Azure Front Door services, making it
easier to correlate logs across different components.
To enable this feature, add
PrivatePreviewEnableAFDCorrelationIdEnrichment=true to your connection string:
options.AddGenevaLogExporter(exporterOptions =>
{
exporterOptions.ConnectionString = "PrivatePreviewEnableAFDCorrelationIdEnrichment=true";
});
When enabled, the exporter automatically adds an AFDCorrelationId attribute to
each log record if the value is present in RuntimeContext.
This snippet shows how to configure the Geneva Exporter for Traces
using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.SetSampler(new AlwaysOnSampler())
.AddSource("DemoSource")
.AddGenevaTraceExporter(options => {
options.ConnectionString = "EtwSession=OpenTelemetry";
})
.Build();
The above code must be in application startup. In case of ASP.NET Core
applications, this should be in ConfigureServices of Startup class.
For ASP.NET applications, this should be in Global.aspx.cs.
GenevaExporterOptions contains various options to configure the Geneva
Exporter.
ConnectionString (required for Logs and Traces)On Linux the connection string has the format Endpoint=unix:{UDS Path}.
On Windows the connection string has the format EtwSession={ETW session}.
CustomFields (optional)A list of fields which should be stored as individual table columns.
ResourceFieldNames (optional)A list of resource attribute keys which should be sent to Geneva.
PrepopulatedFields (optional)This is a collection of fields that will be applied to all the Logs and Traces sent through this exporter. If ResourceFieldNames is also specified, PrepopulatedFields has no effect.
IncludeTraceStateForSpan (optional)Export activity.TraceStateString as the value for Part B traceState field for
Spans when the IncludeTraceStateForSpan option is set to true.
This is an opt-in feature and the default value is false.
Note that this is for Spans only and not for LogRecord.
TableNameMappings (optional)This defines the mapping for the table name used to store Logs and Traces.
The default table name used for Traces is Span. To change the table name for
Traces add an entry with the key Span and set the value to the desired custom
table name.
Only a single table name is supported for Traces.
The default table name used for Logs is Log. Mappings can be specified
universally or for individual log message
category
values.
To change the default table name for Logs add an entry with the key * and
set the value to the desired custom table name. To enable "pass-through"
mapping set the value of the * key to *. For details on "pass-through"
mode see below.
To change the table name for a specific log
category
add an entry with the key set to the full "category" of the log messages or a
prefix that will match the starting portion of the log message "category". Set
the value of the key to either the desired custom table name or * to enable
"pass-through" mapping. For details on "pass-through" mode see below.
For example, given the configuration...
var options = new GenevaExporterOptions
{
TableNameMappings = new Dictionary<string, string>()
{
["*"] = "DefaultLogs",
["MyCompany"] = "InternalLogs",
["MyCompany.Product1"] = "InternalProduct1Logs",
["MyCompany.Product2"] = "InternalProduct2Logs",
["MyCompany.Product2.Security"] = "InternalSecurityLogs",
["MyPartner"] = "*",
},
};
...log category mapping would be performed as such:
ILogger<ThirdParty.Thing>: This would go to "DefaultLogs"ILogger<MyCompany.ProductX.Thing>: This would go to "InternalLogs"ILogger<MyCompany.Product1.Thing>: This would go to "InternalProduct1Logs"ILogger<MyCompany.Product2.Thing>: This would go to "InternalProduct2Logs"ILogger<MyCompany.Product2.Security.Alert>: This would go to
"InternalSecurityLogs"ILogger<MyPartner.Product.Thing>: This is marked as pass-through ("*") so
it will be sanitized as "MyPartnerProductThing" table nameWhen "pass-through" mapping is enabled for a given log message the runtime category value will be converted into a valid table name.
The first character MUST be an ASCII letter. If it is lower-case, it will be converted into an upper-case letter. If the first character is invalid all log messages for the "category" will be dropped.
Any non-ASCII letter or number will be removed.
Only the first 50 valid characters will be used.
In this example named options ('GenevaTracing') are used. This is because
GenevaExporterOptions is shared by both logging & tracing. In a future
version named options will also be supported in logging so it is recommended
to use named options now for tracing in order to future-proof this code.
// Step 1: Turn on tracing and register GenevaTraceExporter.
builder.Services.AddOpenTelemetry()
.WithTracing(builder => builder
.AddGenevaTraceExporter(
"GenevaTracing", // Tell GenevaTraceExporter to retrieve options using the 'GenevaTracing' name
_ => { }));
// Step 2: Use Options API to configure GenevaExporterOptions using services
// retrieved from the dependency injection container
builder.Services
.AddOptions<GenevaExporterOptions>("GenevaTracing") // Register options with the 'GenevaTracing' name
.Configure<IConfiguration>((exporterOptions, configuration) =>
{
exporterOptions.ConnectionString = configuration.GetValue<string>("OpenTelemetry:Tracing:GenevaConnectionString")
?? throw new InvalidOperationException("GenevaConnectionString was not found in application configuration");
});
// Step 1: Turn on logging.
builder.Logging.AddOpenTelemetry();
// Step 2: Use Options API to configure OpenTelemetryLoggerOptions using
// services retrieved from the dependency injection container
builder.Services
.AddOptions<OpenTelemetryLoggerOptions>()
.Configure<IConfiguration>((loggerOptions, configuration) =>
{
// Add GenevaLogExporter and configure GenevaExporterOptions using
// services retrieved from the dependency injection container
loggerOptions.AddGenevaLogExporter(exporterOptions =>
{
exporterOptions.ConnectionString = configuration.GetValue<string>("OpenTelemetry:Logging:GenevaConnectionString")
?? throw new InvalidOperationException("GenevaConnectionString was not found in application configuration");
});
});
This snippet shows how to configure the Geneva Exporter for Metrics
using var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("TestMeter")
.AddGenevaMetricExporter(options =>
{
options.ConnectionString = "Account=OTelMonitoringAccount;Namespace=OTelMetricNamespace";
})
.Build();
The above code must be in application startup. In case of ASP.NET Core
applications, this should be in ConfigureServices of Startup class.
For ASP.NET applications, this should be in Global.aspx.cs.
GenevaMetricExporterOptions contains various options which are required to
configure the GenevaMetricExporter.
ConnectionString (required for Metrics)On Windows DO NOT provide an ETW session name for Metrics, only specify
Account and Namespace. For example:
Account={MetricAccount};Namespace={MetricNamespace}.
On Linux provide an Endpoint in addition to the Account and Namespace.
For example:
Endpoint=unix:{UDS Path};Account={MetricAccount};Namespace={MetricNamespace}.
An experimental feature flag is available to opt-into changing the underlying serialization format to binary protobuf following the schema defined in OTLP specification.
When using OTLP protobuf encoding Account and Namespace are NOT required
to be set on the ConnectionString. The recommended approach is to use
OpenTelemetry Resource instead:
using var meterProvider = Sdk.CreateMeterProviderBuilder()
// Other configuration not shown
.ConfigureResource(r => r.AddAttributes(
new Dictionary<string, object>()
{
["_microsoft_metrics_account"] = "MetricsAccountGoesHere",
["_microsoft_metrics_namespace"] = "MetricsNamespaceGoesHere",
}))
.AddGenevaMetricExporter(options =>
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
options.ConnectionString = "PrivatePreviewEnableOtlpProtobufEncoding=true";
}
else
{
// Note: 1.10.0+ version required to use OTLP protobuf encoding on Linux
// Use Unix domain socket mode
options.ConnectionString = "Endpoint=unix:{OTLP UDS Path};PrivatePreviewEnableOtlpProtobufEncoding=true";
// Use user_events mode (preferred but considered experimental as this is a new capability in Linux kernel)
// options.ConnectionString = "PrivatePreviewEnableOtlpProtobufEncoding=true";
}
})
.Build();
To send metric data over ETW using OTLP protobuf encoding set
PrivatePreviewEnableOtlpProtobufEncoding=true on the ConnectionString.
As of 1.10.0 PrivatePreviewEnableOtlpProtobufEncoding=true is also supported
on Linux.
To send metric data over UDS using OTLP protobuf encoding set the Endpoint to
use the correct OtlpSocketPath path and set
PrivatePreviewEnableOtlpProtobufEncoding=true on the ConnectionString:
Endpoint=unix:{OTLP UDS Path};PrivatePreviewEnableOtlpProtobufEncoding=true.
OTLP over UDS requires a different socket path than TLV over UDS.
user_events are a newer feature of the Linux kernel and require a distro with the feature enabled.
To send metric data over user_events using OTLP protobuf encoding do NOT
specify an Endpoint and set PrivatePreviewEnableOtlpProtobufEncoding=true on
the ConnectionString.
MetricExportIntervalMilliseconds (optional)Set the exporter's periodic time interval to export Metrics. The default value is 60000 milliseconds.
PrepopulatedMetricDimensions (optional)This is a collection of the dimensions that will be applied to every metric exported by the exporter.
// Step 1: Turn on metrics and register GenevaMetricExporter.
builder.Services.AddOpenTelemetry()
.WithMetrics(builder => builder.AddGenevaMetricExporter());
// Step 2: Use Options API to configure GenevaMetricExporterOptions using
// services retrieved from the dependency injection container
builder.Services
.AddOptions<GenevaMetricExporterOptions>()
.Configure<IConfiguration>((exporterOptions, configuration) =>
{
exporterOptions.ConnectionString = configuration.GetValue<string>("OpenTelemetry:Metrics:GenevaConnectionString")
?? throw new InvalidOperationException("GenevaConnectionString was not found in application configuration");
});
Before digging into a problem, check if you hit a known issue by looking at the CHANGELOG.md and GitHub issues.
Geneva Exporters uses an EventSource with the name "OpenTelemetry-Exporter-Geneva" for its internal logging. Please follow the troubleshooting guide for OpenTelemetry .NET for instructions on seeing Logs from the geneva exporter, as well as other OpenTelemetry components.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on OpenTelemetry.Exporter.Geneva:
| Package | Downloads |
|---|---|
|
telemetra.monitoring
Telemetra Monitoring SDK provides a unified, extensible, and production-ready observability solution for .NET applications. It enables seamless collection and export of traces, metrics, and logs to multiple backends (OTLP, Jaeger, Grafana, Sentry, Tempo, Alloy, Console, Prometheus, Zipkin) with advanced configuration, business insights, and enterprise features. |
Showing the top 4 popular GitHub repositories that depend on OpenTelemetry.Exporter.Geneva:
| Repository | Stars |
|---|---|
|
dotnet/runtime
.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
|
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
|
|
|
VSadov/Satori
Experimenting with dotnet runtime.
|
|
|
microsoft/winget-cli-restsource
This project aims to provide a reference implementation for creating a REST based package source for the winget client.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.15.2 | 72,985 | 4/21/2026 |
| 1.15.1 | 15,364 | 2/18/2026 |
| 1.13.0 | 4,740 | 10/13/2025 |
| 1.13.0-alpha.1 | 281 | 6/7/2025 |
| 1.12.0 | 140,942 | 5/6/2025 |
| 1.11.3 | 53,123 | 4/22/2025 |
| 1.11.2 | 22,593 | 4/16/2025 |
| 1.11.1 | 35,265 | 3/5/2025 |
| 1.11.0 | 84,648 | 2/3/2025 |
| 1.10.0 | 43,303 | 11/18/2024 |
| 1.9.0 | 108,927 | 6/21/2024 |
| 1.9.0-rc.2 | 251 | 6/17/2024 |
| 1.9.0-rc.1 | 212 | 6/12/2024 |
| 1.9.0-alpha.1 | 196 | 5/22/2024 |
| 1.8.0 | 1,029,068 | 5/16/2024 |
| 1.8.0-rc.2 | 187 | 5/13/2024 |
| 1.8.0-rc.1 | 182 | 5/2/2024 |