OpenTelemetry.Exporter.Geneva
1.13.0
Prefix Reserved
dotnet add package OpenTelemetry.Exporter.Geneva --version 1.13.0
NuGet\Install-Package OpenTelemetry.Exporter.Geneva -Version 1.13.0
<PackageReference Include="OpenTelemetry.Exporter.Geneva" Version="1.13.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Geneva" Version="1.13.0" />
<PackageReference Include="OpenTelemetry.Exporter.Geneva" />
paket add OpenTelemetry.Exporter.Geneva --version 1.13.0
#r "nuget: OpenTelemetry.Exporter.Geneva, 1.13.0"
#:package OpenTelemetry.Exporter.Geneva@1.13.0
#addin nuget:?package=OpenTelemetry.Exporter.Geneva&version=1.13.0
#tool nuget:?package=OpenTelemetry.Exporter.Geneva&version=1.13.0
Geneva Exporter for OpenTelemetry .NET
Status | |
---|---|
Stability | Stable |
Code Owners | @rajkumar-rangaraj, @xiang17 |
The Geneva Exporter exports telemetry to Event Tracing for Windows (ETW) or to a Unix Domain Socket (UDS) on the local machine.
Installation
dotnet add package OpenTelemetry.Exporter.Geneva
Configuration
The three types of telemetry are handled separately in OpenTelemetry. Therefore, each type of telemetry must be enabled separately.
Enable Logs
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.
AFD CorrelationId Enrichment
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
.
Enable Traces
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 (for Logs and Traces)
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.
- If null, all fields will be stored as individual columns.
- If non-null, only those fields named in the list will be stored as individual columns.
PrepopulatedFields
(optional)
This is a collection of fields that will be applied to all the Logs and Traces sent through this exporter.
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.
Trace table name mappings
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.
Log table name mappings
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 name
Pass-through table name mapping rules
When "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.
How to configure GenevaExporterOptions using dependency injection
Tracing
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");
});
Logging
// 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");
});
});
Enable Metrics
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 (for Metrics)
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}
.
OtlpProtobufEncoding
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();
Windows
To send metric data over ETW using OTLP protobuf encoding set
PrivatePreviewEnableOtlpProtobufEncoding=true
on the ConnectionString
.
Linux
As of 1.10.0
PrivatePreviewEnableOtlpProtobufEncoding=true
is also supported
on Linux.
When using unix domain socket
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.
When using user_events
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.
How to configure GenevaMetricExporterOptions using dependency injection
// 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");
});
Troubleshooting
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 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- OpenTelemetry (>= 1.13.1 && < 2.0.0)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.0.0)
-
.NETStandard 2.0
- OpenTelemetry (>= 1.13.1 && < 2.0.0)
-
net8.0
- OpenTelemetry (>= 1.13.1 && < 2.0.0)
NuGet packages (1)
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. |
GitHub repositories (4)
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.
|
|
microsoft/winget-cli-restsource
This project aims to provide a reference implementation for creating a REST based package source for the winget client.
|
|
VSadov/Satori
Experimenting with dotnet runtime.
|
Version | Downloads | Last Updated | |
---|---|---|---|
1.13.0 | 1,096 | 10/13/2025 | |
1.13.0-alpha.1 | 180 | 6/7/2025 | |
1.12.0 | 110,334 | 5/6/2025 | |
1.11.3 | 47,138 | 4/22/2025 | |
1.11.2 | 900 | 4/16/2025 | |
1.11.1 | 32,921 | 3/5/2025 | |
1.11.0 | 48,405 | 2/3/2025 | |
1.10.0 | 41,200 | 11/18/2024 | |
1.9.0 | 87,964 | 6/21/2024 | |
1.9.0-rc.2 | 191 | 6/17/2024 | |
1.9.0-rc.1 | 154 | 6/12/2024 | |
1.9.0-alpha.1 | 143 | 5/22/2024 | |
1.8.0 | 642,706 | 5/16/2024 | |
1.8.0-rc.2 | 129 | 5/13/2024 | |
1.8.0-rc.1 | 111 | 5/2/2024 | |
1.7.0 | 13,774 | 12/12/2023 | |
1.7.0-rc.1 | 168 | 12/6/2023 | |
1.7.0-alpha.1 | 340 | 9/22/2023 | |
1.6.0 | 130,675 | 9/8/2023 | |
1.6.0-rc.1 | 193 | 8/28/2023 | |
1.6.0-alpha.1 | 342 | 7/13/2023 | |
1.5.1 | 14,381 | 6/29/2023 | |
1.5.0 | 7,668 | 6/15/2023 | |
1.5.0-rc.1 | 1,282 | 6/2/2023 | |
1.5.0-alpha.3 | 485 | 4/20/2023 | |
1.5.0-alpha.2 | 538 | 3/29/2023 | |
1.5.0-alpha.1 | 254 | 3/14/2023 | |
1.4.1 | 18,335 | 3/29/2023 | |
1.4.0-rc.4 | 290 | 2/14/2023 | |
1.4.0-rc.3 | 236 | 2/8/2023 | |
1.4.0-rc.2 | 293 | 1/30/2023 | |
1.4.0-rc.1 | 955 | 12/20/2022 | |
1.4.0-beta.6 | 243 | 12/9/2022 | |
1.4.0-beta.5 | 528 | 11/21/2022 | |
1.4.0-beta.4 | 606 | 10/28/2022 | |
1.4.0-beta.3 | 333 | 10/20/2022 | |
1.4.0-beta.2 | 268 | 10/17/2022 | |
1.4.0-beta.1 | 5,735 | 8/1/2022 | |
1.3.1 | 16,292 | 12/7/2022 | |
1.3.0-beta.2 | 1,860 | 6/3/2022 | |
1.3.0-beta.1 | 267 | 5/27/2022 | |
1.2.6 | 53,540 | 4/21/2022 |