Available instrumentations

OpenTelemetry .NET Automatic Instrumentation supported libraries.

The OpenTelemetry .NET Automatic Instrumentation supports a wide variety of libraries.

Instrumentations

All instrumentations are enabled by default for all signal types (traces, metrics, and logs).

You can disable all instrumentations for a specific signal type by setting the OTEL_DOTNET_AUTO_{SIGNAL}_INSTRUMENTATION_ENABLED environment variable to false.

For a more granular approach, you can disable specific instrumentations for a given signal type by setting the OTEL_DOTNET_AUTO_{SIGNAL}_{0}_INSTRUMENTATION_ENABLED environment variable to false, where {SIGNAL} is the type of signal, for example TRACES, and {0} is the case-sensitive name of the instrumentation.

Environment variableDescriptionDefault valueStatus
OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLEDEnables all instrumentations.trueExperimental
OTEL_DOTNET_AUTO_TRACES_INSTRUMENTATION_ENABLEDEnables all trace instrumentations. Overrides OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLED.Inherited from the current value of OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLEDExperimental
OTEL_DOTNET_AUTO_TRACES_{0}_INSTRUMENTATION_ENABLEDConfiguration pattern for enabling a specific trace instrumentation, where {0} is the uppercase ID of the instrumentation you want to enable. Overrides OTEL_DOTNET_AUTO_TRACES_INSTRUMENTATION_ENABLED.Inherited from the current value of OTEL_DOTNET_AUTO_TRACES_INSTRUMENTATION_ENABLEDExperimental
OTEL_DOTNET_AUTO_METRICS_INSTRUMENTATION_ENABLEDDisables all metric instrumentations. Overrides OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLED.Inherited from the current value of OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLEDExperimental
OTEL_DOTNET_AUTO_METRICS_{0}_INSTRUMENTATION_ENABLEDConfiguration pattern for enabling a specific metric instrumentation, where {0} is the uppercase ID of the instrumentation you want to enable. Overrides OTEL_DOTNET_AUTO_METRICS_INSTRUMENTATION_ENABLED.Inherited from the current value of OTEL_DOTNET_AUTO_METRICS_INSTRUMENTATION_ENABLEDExperimental
OTEL_DOTNET_AUTO_LOGS_INSTRUMENTATION_ENABLEDDisables all log instrumentations. Overrides OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLED.Inherited from the current value of OTEL_DOTNET_AUTO_INSTRUMENTATION_ENABLEDExperimental
OTEL_DOTNET_AUTO_LOGS_{0}_INSTRUMENTATION_ENABLEDConfiguration pattern for enabling a specific log instrumentation, where {0} is the uppercase ID of the instrumentation you want to enable. Overrides OTEL_DOTNET_AUTO_LOGS_INSTRUMENTATION_ENABLED.Inherited from the current value of OTEL_DOTNET_AUTO_LOGS_INSTRUMENTATION_ENABLEDExperimental

Traces instrumentations

Status: Mixed. Traces are stable, but particular instrumentation libraries are in Experimental status due to lack of stable semantic convention.

IDInstrumented librarySupported versionsInstrumentation typeStatus
ASPNETASP.NET (.NET Framework) MVC / WebApi [1] Not supported on .NET* [2]source & bytecodeExperimental
ASPNETCOREASP.NET Core Not supported on .NET Framework*sourceExperimental
AZUREAzure SDK[3]sourceExperimental
ELASTICSEARCHElastic.Clients.Elasticsearch* [4]sourceExperimental
ELASTICTRANSPORTElastic.Transport≥0.4.16sourceExperimental
ENTITYFRAMEWORKCOREMicrosoft.EntityFrameworkCore Not supported on .NET Framework≥6.0.12sourceExperimental
GRAPHQLGraphQL Not supported on .NET Framework≥7.5.0sourceExperimental
GRPCNETCLIENTGrpc.Net.Client≥2.52.0 & < 3.0.0sourceExperimental
HTTPCLIENTSystem.Net.Http.HttpClient and System.Net.HttpWebRequest*sourceExperimental
KAFKAConfluent.Kafka≥1.4.0 & < 3.0.0 [5]bytecodeExperimental
MASSTRANSITMassTransit Not supported on .NET Framework≥8.0.0sourceExperimental
MONGODBMongoDB.Driver.Core≥2.13.3 & < 3.0.0source & bytecodeExperimental
MYSQLCONNECTORMySqlConnector≥2.0.0sourceExperimental
MYSQLDATAMySql.Data Not supported on .NET Framework≥8.1.0sourceExperimental
NPGSQLNpgsql≥6.0.0sourceExperimental
NSERVICEBUSNServiceBus≥8.0.0 & < 10.0.0source & bytecodeExperimental
ORACLEMDAOracle.ManagedDataAccess.Core and Oracle.ManagedDataAccess Not supported on ARM64≥23.4.0sourceExperimental
QUARTZQuartz Not supported on .NET Framework 4.7.1 and older≥3.4.0sourceExperimental
SQLCLIENTMicrosoft.Data.SqlClient, System.Data.SqlClient and System.Data (shipped with .NET Framework)* [6]sourceExperimental
STACKEXCHANGEREDISStackExchange.Redis Not supported on .NET Framework≥2.0.405 & < 3.0.0source & bytecodeExperimental
WCFCLIENTWCF*source & bytecodeExperimental
WCFSERVICEWCF Not supported on .NET.*source & bytecodeExperimental

[1]: Only integrated pipeline mode is supported.

[2]: ASP.NET (.NET Framework) MVC / WebApi is not supported on ARM64.

[3]: Azure. prefixed packages, released after October 1, 2021.

[4]: Elastic.Clients.Elasticsearch version ≥8.0.0 and <8.10.0. Version ≥8.10.0 is supported by Elastic.Transport instrumentation.

[5]: Confluent.Kafka is supported from version ≥1.8.2 on ARM64.

[6]: Microsoft.Data.SqlClient v3.* is not supported on .NET Framework, due to issue. System.Data.SqlClient is supported from version 4.8.5.

Metrics instrumentations

Status: Mixed. Metrics are stable, but particular instrumentation are in Experimental status due to lack of stable semantic convention.

IDInstrumented libraryDocumentationSupported versionsInstrumentation typeStatus
ASPNETASP.NET Framework [1] Not supported on .NETASP.NET metrics*source & bytecodeExperimental
ASPNETCOREASP.NET Core [2] Not supported on .NET FrameworkASP.NET Core metrics*sourceExperimental
HTTPCLIENTSystem.Net.Http.HttpClient and System.Net.HttpWebRequestHttpClient metrics*sourceExperimental
NETRUNTIMEOpenTelemetry.Instrumentation.RuntimeRuntime metrics*sourceExperimental
PROCESSOpenTelemetry.Instrumentation.ProcessProcess metrics*sourceExperimental
NSERVICEBUSNServiceBusNServiceBus metrics≥8.0.0 & < 10.0.0source & bytecodeExperimental

[1]: The ASP.NET metrics are generated only if the AspNet trace instrumentation is also enabled.

[2]: This instrumentation automatically enables the Microsoft.AspNetCore.Hosting.HttpRequestIn spans.

Logs instrumentations

Status: Experimental.

IDInstrumented librarySupported versionsInstrumentation typeStatus
ILOGGERMicrosoft.Extensions.Logging Not supported on .NET Framework≥8.0.0bytecode or sourceExperimental

For ASP.NET Core applications, the LoggingBuilder instrumentation can be enabled without using the .NET CLR Profiler by setting the ASPNETCORE_HOSTINGSTARTUPASSEMBLIES environment variable to OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper.

Instrumentation options

Environment variableDescriptionDefault valueStatus
OTEL_DOTNET_AUTO_ENTITYFRAMEWORKCORE_SET_DBSTATEMENT_FOR_TEXTWhether the Entity Framework Core instrumentation can pass SQL statements through the db.statement attribute. Queries might contain sensitive information. If set to false, db.statement is recorded only for executing stored procedures.falseExperimental
OTEL_DOTNET_AUTO_GRAPHQL_SET_DOCUMENTWhether the GraphQL instrumentation can pass raw queries through the graphql.document attribute. Queries might contain sensitive information.falseExperimental
OTEL_DOTNET_AUTO_ORACLEMDA_SET_DBSTATEMENT_FOR_TEXTWhether the Oracle Client instrumentation can pass SQL statements through the db.statement attribute. Queries might contain sensitive information. If set to false, db.statement is recorded only for executing stored procedures.falseExperimental
OTEL_DOTNET_AUTO_SQLCLIENT_SET_DBSTATEMENT_FOR_TEXTWhether the SQL Client instrumentation can pass SQL statements through the db.statement attribute. Queries might contain sensitive information. If set to false, db.statement is recorded only for executing stored procedures. Not supported on .NET Framework for System.Data.SqlClient.falseExperimental
OTEL_DOTNET_AUTO_TRACES_ASPNET_INSTRUMENTATION_CAPTURE_REQUEST_HEADERSA comma-separated list of HTTP header names. ASP.NET instrumentations will capture HTTP request header values for all configured header names.Experimental
OTEL_DOTNET_AUTO_TRACES_ASPNET_INSTRUMENTATION_CAPTURE_RESPONSE_HEADERSA comma-separated list of HTTP header names. ASP.NET instrumentations will capture HTTP response header values for all configured header names. Not supported on IIS Classic mode.Experimental
OTEL_DOTNET_AUTO_TRACES_ASPNETCORE_INSTRUMENTATION_CAPTURE_REQUEST_HEADERSA comma-separated list of HTTP header names. ASP.NET Core instrumentations will capture HTTP request header values for all configured header names.Experimental
OTEL_DOTNET_AUTO_TRACES_ASPNETCORE_INSTRUMENTATION_CAPTURE_RESPONSE_HEADERSA comma-separated list of HTTP header names. ASP.NET Core instrumentations will capture HTTP response header values for all configured header names.Experimental
OTEL_DOTNET_AUTO_TRACES_GRPCNETCLIENT_INSTRUMENTATION_CAPTURE_REQUEST_METADATAA comma-separated list of gRPC metadata names. Grpc.Net.Client instrumentations will capture gRPC request metadata values for all configured metadata names.Experimental
OTEL_DOTNET_AUTO_TRACES_GRPCNETCLIENT_INSTRUMENTATION_CAPTURE_RESPONSE_METADATAA comma-separated list of gRPC metadata names. Grpc.Net.Client instrumentations will capture gRPC response metadata values for all configured metadata names.Experimental
OTEL_DOTNET_AUTO_TRACES_HTTP_INSTRUMENTATION_CAPTURE_REQUEST_HEADERSA comma-separated list of HTTP header names. HTTP Client instrumentations will capture HTTP request header values for all configured header names.Experimental
OTEL_DOTNET_AUTO_TRACES_HTTP_INSTRUMENTATION_CAPTURE_RESPONSE_HEADERSA comma-separated list of HTTP header names. HTTP Client instrumentations will capture HTTP response header values for all configured header names.Experimental
OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_DISABLE_URL_QUERY_REDACTIONWhether the ASP.NET Core instrumentation turns off redaction of the url.query attribute value.falseExperimental
OTEL_DOTNET_EXPERIMENTAL_HTTPCLIENT_DISABLE_URL_QUERY_REDACTIONWhether the HTTP client instrumentation turns off redaction of the url.full attribute value.falseExperimental
OTEL_DOTNET_EXPERIMENTAL_ASPNET_DISABLE_URL_QUERY_REDACTIONWhether the ASP.NET instrumentation turns off redaction of the url.query attribute value.falseExperimental