Quarkus Opentelemetry Exporter for Microsoft Azure
This exporter sends data to the Azure portal.
General configuration
Add the Azure exporter extension to your build file.
For Maven:
<dependency>
<groupId>io.quarkiverse.opentelemetry.exporter</groupId>
<artifactId>quarkus-opentelemetry-exporter-azure</artifactId>
<version>3.40.1.0</version>
</dependency>
You also need an Application Insights resource receiving the telemetry data. Go to the Azure portal, search for your Application Insights resource or create a new one. On the overview page of your resource, you will find a connection string in the top right corner.
You have two options to set the connection string, one using the Quarkus naming semantics and the other one using the default naming from the Azure documentation.
To set the connection string with the Quarkus naming semantics:
-
With the
application.propertiesfile
quarkus.otel.azure.applicationinsights.connection.string=your_connection_string
-
With the
QUARKUS_OTEL_AZURE_APPLICATIONINSIGHTS_CONNECTION_STRING=your_connection_stringenvironment variable
If you want to use the Azure Application Insights way of specifying the connection string, which takes precedence over the Quarkus way:
-
With the
application.propertiesfile
applicationinsights.connection.string=your_connection_string
Read this page to learn more configuration options.
Enable more instrumentation
-
Set the
quarkus.otel.logs.enabledproperty totrueto enable the logging instrumentation -
Read this documentation to enable the JDBC instrumentation
-
Read this documentation to enable additional instrumentations
Sampling
The extension registers its own OpenTelemetry Sampler bean, the Azure endpoint sampler. It drops the spans of the HTTP
requests sent by the exporter itself to the Application Insights ingestion and statsbeat endpoints, so that the
telemetry export does not show up as a dependency of your application, and samples every other span (always_on).
Quarkus uses a single Sampler bean, the one with the highest priority. The Azure endpoint sampler is registered with
priority 100, which makes it take precedence over a Sampler bean declared by the application with the default
priority: such a sampler is ignored.
To use your own sampler instead, give it a priority higher than 100:
@Singleton
@Priority(200)
public class MySampler implements Sampler {
// ...
}
Your sampler then replaces the Azure endpoint sampler entirely, which means the export requests are traced again unless your implementation drops them as well.