{"id":232175,"date":"2025-06-12T05:18:47","date_gmt":"2025-06-12T12:18:47","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=232175"},"modified":"2025-06-16T14:22:17","modified_gmt":"2025-06-16T21:22:17","slug":"monitor-your-quarkus-native-application-on-azure","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/monitor-your-quarkus-native-application-on-azure\/","title":{"rendered":"Monitor your Quarkus native application on Azure"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p><span class=\"TextRun SCXW38326939 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><a href=\"https:\/\/quarkus.io\/\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW38326939 BCX8\">Quarkus<\/span><\/a><span class=\"NormalTextRun SCXW38326939 BCX8\"> is a <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW38326939 BCX8\">general-purpose<\/span><span class=\"NormalTextRun SCXW38326939 BCX8\"> Java framework focused on efficient use of resources, fast <span class=\"NormalTextRun SCXW105487381 BCX8\">s<\/span><span class=\"NormalTextRun SCXW105487381 BCX8\">tartup, <\/span><\/span><\/span><span class=\"TextRun SCXW38326939 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW38326939 BCX8\">and <\/span><span class=\"NormalTextRun SCXW38326939 BCX8\">rapid <\/span><span class=\"NormalTextRun SCXW38326939 BCX8\">development. It allows developers to create and run services in the Java Virtual Machine (JVM) <\/span><span class=\"NormalTextRun SCXW38326939 BCX8\">or<\/span><span class=\"NormalTextRun SCXW38326939 BCX8\"> native binary executables (native mode).<\/span><\/span><\/p>\n<p><span class=\"TextRun SCXW160072553 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW160072553 BCX8\">In this blog post we are going to focus on using <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW160072553 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW160072553 BCX8\"> to <\/span><span class=\"NormalTextRun SCXW160072553 BCX8\">create and<\/span> <span class=\"NormalTextRun SCXW160072553 BCX8\">monitor<\/span><span class=\"NormalTextRun SCXW160072553 BCX8\"> a native mode <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW160072553 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW160072553 BCX8\"> application on Azure.<\/span><\/span><\/p>\n<p><span class=\"TextRun SCXW235844932 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW235844932 BCX8\">A simple service will be created from scratch to <\/span><span class=\"NormalTextRun SCXW235844932 BCX8\">demonstrate<\/span><span class=\"NormalTextRun SCXW235844932 BCX8\"> the capability of sending <\/span><a href=\"https:\/\/opentelemetry.io\/\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW235844932 BCX8\">OpenTelemetry<\/span><\/a><span class=\"NormalTextRun SCXW235844932 BCX8\"> data to Azure.<\/span><\/span><span class=\"EOP Selected SCXW235844932 BCX8\" data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Why native?<\/span><\/h2>\n<p><span class=\"TextRun SCXW209187246 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SpellingErrorV2Themed SCXW209187246 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW209187246 BCX8\"> Native Mode refers to building and running a <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW209187246 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW209187246 BCX8\"> application as a native binary executable, using <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW209187246 BCX8\">GraalVM<\/span><span class=\"NormalTextRun SCXW209187246 BCX8\"> to compile the application <\/span><span class=\"NormalTextRun SCXW209187246 BCX8\">A<\/span><span class=\"NormalTextRun SCXW209187246 BCX8\">head <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW209187246 BCX8\">O<\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW209187246 BCX8\">f<\/span> <span class=\"NormalTextRun SCXW209187246 BCX8\">T<\/span><span class=\"NormalTextRun SCXW209187246 BCX8\">ime (AOT) into a platform-specific binary. <\/span><span class=\"NormalTextRun SCXW209187246 BCX8\">That is, <span class=\"NormalTextRun SCXW229534080 BCX8\">there is<\/span> <span class=\"NormalTextRun SCXW229534080 BCX8\">n<\/span><span class=\"NormalTextRun SCXW229534080 BCX8\">o<\/span><span class=\"NormalTextRun SCXW229534080 BCX8\"> JVM <\/span><span class=\"NormalTextRun SCXW229534080 BCX8\">required<\/span><span class=\"NormalTextRun SCXW229534080 BCX8\"> at runtime<\/span><\/span><span class=\"NormalTextRun SCXW209187246 BCX8\">.<\/span><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Recommended scenarios for native mode:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW144848920 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW144848920 BCX8\">Fast start-up <\/span><span class=\"NormalTextRun SCXW144848920 BCX8\">required<\/span><span class=\"NormalTextRun SCXW144848920 BCX8\"> (function)<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW98735637 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW98735637 BCX8\">No JDK<\/span><span class=\"NormalTextRun SCXW98735637 BCX8\">\/JRE<\/span><span class=\"NormalTextRun SCXW98735637 BCX8\"> available on the host machine<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW60117278 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW60117278 BCX8\">Reduced attack surface (No reflection, less classes loaded, See:\u202f<\/span><\/span><a class=\"Hyperlink SCXW60117278 BCX8\" href=\"https:\/\/www.graalvm.org\/why-graalvm\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW60117278 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW60117278 BCX8\" data-ccp-charstyle=\"Hyperlink\">https:\/\/www.graalvm.org\/why-graalvm<\/span><\/span><\/a><span class=\"TextRun SCXW60117278 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW60117278 BCX8\">\u202f)\u202f<\/span><\/span><span class=\"EOP Selected SCXW60117278 BCX8\" data-ccp-props=\"{}\">\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\">Applications running for a short amount of time (function)<\/li>\n<li data-stringify-indent=\"0\" data-stringify-border=\"0\">High density deployments with many instances running in parallel<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW141001117 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW141001117 BCX8\">Application with a low CPU or memory limits<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW65820845 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW65820845 BCX8\">Applications running with constrained resources like:<\/span><\/span>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Edge services<\/span><\/li>\n<li><span style=\"font-weight: 400;\">IoT services\u00a0<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Disadvantages:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Longer build times<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW104937870 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW104937870 BCX8\">Increased memory at build time<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW95454509 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW95454509 BCX8\">Reduced GC options. <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW95454509 BCX8\">GraalVM<\/span><span class=\"NormalTextRun SCXW95454509 BCX8\"> CE only supports the serial and epsilon garbage collectors (GC). The <\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">S<\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">erial GC is single threaded, and the <\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">E<\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">psilon <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW95454509 BCX8\">GC <\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">is <\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">a no-op garbage collector used to disable garbage collection<\/span><span class=\"NormalTextRun SCXW95454509 BCX8\"> if your application is allocation free<\/span><span class=\"NormalTextRun SCXW95454509 BCX8\">.<\/span><\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span class=\"TextRun SCXW73109232 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW73109232 BCX8\">Compared with a <\/span><span class=\"NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW73109232 BCX8\">warmed-up<\/span><span class=\"NormalTextRun SCXW73109232 BCX8\"> application running on the JVM, the throughput is usually <\/span><span class=\"NormalTextRun SCXW73109232 BCX8\">less<\/span><\/span><\/li>\n<\/ul>\n<h2>Create a demo application<\/h2>\n<h3><span style=\"font-weight: 400;\">Generate the application<\/span><\/h3>\n<p><span class=\"TextRun SCXW206318396 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW206318396 BCX8\">We\u2019ll<\/span><span class=\"NormalTextRun SCXW206318396 BCX8\"> be building a service from scratch, but <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW206318396 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW206318396 BCX8\"> has a quick start process to help us!<\/span><\/span><\/p>\n<p><span class=\"TextRun SCXW90273761 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW90273761 BCX8\">Let\u2019s<\/span><span class=\"NormalTextRun SCXW90273761 BCX8\"> go to\u202f<\/span><\/span><a class=\"Hyperlink SCXW90273761 BCX8\" href=\"https:\/\/code.quarkus.io\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"TextRun Underlined SCXW90273761 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW90273761 BCX8\" data-ccp-charstyle=\"Hyperlink\">https:\/\/code.quarkus.io\/<\/span><\/span><\/a><span class=\"TextRun SCXW90273761 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW90273761 BCX8\">, a website where <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW90273761 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW90273761 BCX8\"> projects can be easily generated. For this case, you only need to select the following extensions:<\/span><\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>quarkus-rest-jackson<\/b><span style=\"font-weight: 400;\"> &#8211; REST server with Jackson serialization capabilities.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>quarkus-hibernate-orm<\/b><span style=\"font-weight: 400;\"> &#8211; data persistence<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>quarkus-agroal<\/b><span style=\"font-weight: 400;\"> &#8211; DB connection pool<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>quarkus-jdbc-h2<\/b><span style=\"font-weight: 400;\">\u00a0 &#8211; H2 in-memory DB connection<\/span><\/li>\n<li aria-level=\"1\"><b>quarkus-opentelemetry-exporter-azure <\/b><span style=\"font-weight: 400;\">&#8211; OpenTelemetry extension including the telemetry data exporter for Azure<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/generate-quarkus-app.png\"><img decoding=\"async\" class=\" wp-image-232185 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/generate-quarkus-app-300x213.png\" alt=\"Generate a Quarkus application\" width=\"582\" height=\"413\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/generate-quarkus-app-300x213.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/generate-quarkus-app-768x544.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/generate-quarkus-app.png 1005w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><\/a><\/p>\n<p><span class=\"TextRun SCXW81564210 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW81564210 BCX8\">Click on \u201cGenerate your application\u201d and download the zip file.<\/span><\/span><\/p>\n<p><span class=\"TextRun SCXW72871857 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW72871857 BCX8\">Once saved and extracted on your local machine, please open the project on your IDE of choice.<\/span><\/span><\/p>\n<p><span class=\"TextRun SCXW135296938 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW135296938 BCX8\">The application will provide a REST endpoint and will access an in-memory database. <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW135296938 BCX8\">OpenTelemetry<\/span><span class=\"NormalTextRun SCXW135296938 BCX8\"> tracing already <\/span><span class=\"NormalTextRun SCXW135296938 BCX8\">instruments<\/span><span class=\"NormalTextRun SCXW135296938 BCX8\">\u202fthe<\/span><span class=\"NormalTextRun SCXW135296938 BCX8\"> REST Server and the Database connection manager.\u202f<\/span><\/span><\/p>\n<p><span class=\"TextRun SCXW139260633 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW139260633 BCX8\">Other <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW139260633 BCX8\">Quarkus<\/span><span class=\"NormalTextRun SCXW139260633 BCX8\"> extensions (Kafka, REST, \u2026) can provide <\/span><span class=\"NormalTextRun SCXW139260633 BCX8\">additional<\/span><span class=\"NormalTextRun SCXW139260633 BCX8\"> instrumentation and <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SpellingErrorHighlight SCXW139260633 BCX8\">OpenTelemetry<\/span> <span class=\"NormalTextRun SCXW139260633 BCX8\">data.<\/span><\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Modify the GreetingResource class<\/span><\/h3>\n<p><span class=\"TextRun SCXW130010187 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW130010187 BCX8\">We\u2019ll<\/span> <span class=\"NormalTextRun SCXW130010187 BCX8\">modify<\/span><span class=\"NormalTextRun SCXW130010187 BCX8\"> the bundled <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW130010187 BCX8\">GreetingResource<\/span> <span class=\"NormalTextRun SCXW130010187 BCX8\">class <\/span><span class=\"NormalTextRun SCXW130010187 BCX8\">to add an entry to the <\/span><span class=\"NormalTextRun SCXW130010187 BCX8\">in-memory<\/span><span class=\"NormalTextRun SCXW130010187 BCX8\"> database<\/span><span class=\"NormalTextRun CommentHighlightPipeRest SCXW130010187 BCX8\">.<\/span><\/span><\/p>\n<pre class=\"prettyprint language-java\"><code class=\"language-java\">@Path(\"\/hello\")\r\npublic class GreetingResource {\r\n\r\n    @Inject\r\n    EntityManager manager;\r\n\r\n    @POST\r\n    @Produces(MediaType.TEXT_PLAIN)\r\n    @Transactional\r\n    public String hello() {\r\n        MyEntity o = new MyEntity();\r\n        o.field = \"data to store\";\r\n        manager.persist(o);\r\n        return \"Hello from Quarkus REST\";\r\n    }\r\n}\r\n\r\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Configure database properties<\/span><\/h3>\n<p><span class=\"TextRun SCXW134816236 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW134816236 BCX8\">Add the following properties to the <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW134816236 BCX8\">application.properties<\/span><span class=\"NormalTextRun SCXW134816236 BCX8\"> file to allow you application to access to the H2 database:<\/span><\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">quarkus.datasource.kind=h2\r\nquarkus.datasource.jdbc.url=jdbc:h2:mem:default\r\nquarkus.hibernate-orm.database.generation=drop-and-create<\/code><\/pre>\n<h2>Configure the telemetry features<\/h2>\n<h3>Enable additional telemetry<\/h3>\n<p>We are going to enable OpenTelemetry metrics and logs. <span class=\"TextRun SCXW93409137 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW93409137 BCX8\">In addition, we will enable the JDBC telemetry to provide <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW93409137 BCX8\">OpenTelemetry<\/span> <\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW93409137 BCX8\"><span class=\"TextRun SCXW93409137 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW93409137 BCX8\">J<\/span><\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW93409137 BCX8\"><span class=\"TextRun SCXW93409137 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW93409137 BCX8\">DBC <\/span><\/span><\/span><a class=\"Hyperlink TrackedChange TrackChangeHyperlinkInstruction SCXW93409137 BCX8\" href=\"https:\/\/opentelemetry.io\/docs\/specs\/otel\/overview\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"SCXW93409137 BCX8\"><span class=\"TrackChangeTextInsertion TrackedChange SCXW93409137 BCX8\"><span class=\"TextRun Underlined SCXW93409137 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"FindHit SCXW93409137 BCX8\" data-ccp-charstyle=\"Hyperlink\">span<\/span><\/span><\/span><span class=\"TrackChangeTextInsertion TrackedChange SCXW93409137 BCX8\"><span class=\"TextRun Underlined SCXW93409137 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW93409137 BCX8\" data-ccp-charstyle=\"Hyperlink\">s<\/span><\/span><\/span><\/span><\/a><span class=\"TextRun SCXW93409137 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"> <span class=\"NormalTextRun AdvancedProofingIssueV2Themed SCXW93409137 BCX8\">that is to say SQL executions <\/span><span class=\"NormalTextRun SCXW93409137 BCX8\">in the <\/span><span class=\"NormalTextRun SpellingErrorV2Themed SCXW93409137 BCX8\">OpenTelemetry<\/span><span class=\"NormalTextRun SCXW93409137 BCX8\"> trace.<\/span><\/span><\/p>\n<p>Update your a<i><span style=\"font-weight: 400;\">pplication.properties <\/span><\/i><span style=\"font-weight: 400;\">file<\/span><span style=\"font-weight: 400;\">:<\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">quarkus.otel.logs.enabled=true\r\nquarkus.log.metrics.enabled=true\r\nquarkus.datasource.jdbc.telemetry=true<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">Also add the OpenTelemetry JDBC dependency to the <\/span><i><span style=\"font-weight: 400;\">pom.xml<\/span><\/i><span style=\"font-weight: 400;\">:<\/span><\/p>\n<pre class=\"prettyprint language-xml\"><code class=\"language-xml\">&lt;dependency&gt;\r\n   &lt;groupId&gt;io.opentelemetry.instrumentation&lt;\/groupId&gt;\r\n   &lt;artifactId&gt;opentelemetry-jdbc&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;<\/code><\/pre>\n<h3>Configure the Application Insights connection string<\/h3>\n<p><span style=\"font-weight: 400;\">Create an Azure Application Insights resource if you don&#8217;t have one.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">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 <\/span><a href=\"https:\/\/learn.microsoft.com\/azure\/azure-monitor\/app\/sdk-connection-string\"><span style=\"font-weight: 400;\">in the top right corner<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/connection-string.png\"><img decoding=\"async\" class=\"wp-image-232177 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/connection-string-300x40.png\" alt=\"Copy the connection string\" width=\"729\" height=\"97\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/connection-string-300x40.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/connection-string.png 602w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Create an APPLICATIONINSIGHTS_CONNECTION_STRING <\/span><b>environment variable<\/b><span style=\"font-weight: 400;\"> with the connection string value.\u00a0<\/span><\/p>\n<p><b>The connection string must be kept private and must not be committed to public repositories. <\/b><\/p>\n<h2><span style=\"font-weight: 400;\">Build and run Java native executable<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To build the native executable you need to:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Have <\/span><a href=\"https:\/\/github.com\/graalvm\/graalvm-ce-builds\/releases\/\"><span style=\"font-weight: 400;\">Graalvm CE <\/span><span style=\"font-weight: 400;\">23.0.x.x<\/span><span style=\"font-weight: 400;\">+<\/span><\/a><span style=\"font-weight: 400;\"> from Oracle Labs installed, or <\/span><a href=\"https:\/\/github.com\/graalvm\/mandrel\/wiki#community-compatibility-matrix\"><span style=\"font-weight: 400;\">Mandrel <\/span><span style=\"font-weight: 400;\">23.1.x.x<\/span><\/a><span style=\"font-weight: 400;\"> from Red Hat.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Have Maven 3.9.8+ or Gradle 8.10+ installed.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">All this can be installed with <\/span><a href=\"https:\/\/sdkman.io\/\"><span style=\"font-weight: 400;\">Sdkman<\/span><\/a><span style=\"font-weight: 400;\">.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Set the GRAALVM_HOME environment variable to the location of your GraalVM installation. Example for Mac and Linux:\u00a0<\/span><\/li>\n<\/ol>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">export GRAALVM_HOME=\/Users\/me\/.sdkman\/candidates\/java\/23.0.2-graalce<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">To build the executable, you just need to execute:<\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\"><span class=\"NormalTextRun CommentStart CommentHighlightPipeClicked CommentHighlightClicked SCXW70589920 BCX8\">.\/<\/span><span class=\"NormalTextRun CommentHighlightClicked SCXW70589920 BCX8\">mvn<\/span> clean package -Dnative<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">You can then execute your native executable locally with:<\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">.\/target\/&lt;your app name&gt;-1.0.0-SNAPSHOT-runner<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">\u00a0<\/span><span style=\"font-weight: 400;\">You can use this command to call the application endpoint:<\/span><\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">curl -X POST http:\/\/localhost:8080\/hello<\/code><\/pre>\n<h2 class=\"prettyprint language-default\"><span style=\"font-weight: 400;\">Visualize the telemetry data on Azure<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">We can now come back to our Application Insights resource.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">On the left menu, we click on Application map.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We can then see that our application is calling an H2 database.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/application-map.png\"><img decoding=\"async\" class=\"alignnone wp-image-232228\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/application-map-300x104.png\" alt=\"Application map image\" width=\"938\" height=\"325\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/application-map-300x104.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/application-map-1024x356.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/application-map-768x267.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/application-map-1536x534.png 1536w\" sizes=\"(max-width: 938px) 100vw, 938px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Now we click on Transaction search on the left menu.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The Application Insights UI displays the OpenTelemetry data the following way:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>OpenTelemetry<\/b><\/td>\n<td><b>Application Insights<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Server spans<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Requests<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Log<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Traces<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Other Span Types (Client, Internal, etc.)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Dependencies<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400;\">On the Transaction search we can spot that our Quarkus native application has started up very quickly from the following application log:<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/log-startuppng.png\"><img decoding=\"async\" class=\"alignnone wp-image-232179\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/log-startuppng-300x19.png\" alt=\"Log start up image\" width=\"774\" height=\"49\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/log-startuppng-300x19.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/log-startuppng-1024x66.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/log-startuppng-768x50.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/log-startuppng.png 1470w\" sizes=\"(max-width: 774px) 100vw, 774px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">We can also see the POST call together with SQL activities (get connection, select, insert):<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/request-dependencies.png\"><img decoding=\"async\" class=\"alignnone wp-image-232180\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/request-dependencies-300x137.png\" alt=\"Request and dependencies image\" width=\"559\" height=\"255\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/request-dependencies-300x137.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/request-dependencies-768x350.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/request-dependencies.png 881w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Now, we double click on the POST request.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We can see that SELECT and INSERT statements executed from the POST call:<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1.png\"><img decoding=\"async\" class=\"alignnone wp-image-232181\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1-300x70.png\" alt=\"End to end select image\" width=\"1029\" height=\"240\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1-300x70.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1-1024x238.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1-768x179.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1-1536x357.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-1-2048x476.png 2048w\" sizes=\"(max-width: 1029px) 100vw, 1029px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2.png\"><img decoding=\"async\" class=\"alignnone wp-image-232182\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2-300x68.png\" alt=\"End to end insert image\" width=\"1032\" height=\"234\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2-300x68.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2-1024x232.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2-768x174.png 768w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2-1536x347.png 1536w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2025\/05\/transaction-2-2048x463.png 2048w\" sizes=\"(max-width: 1032px) 100vw, 1032px\" \/><\/a><\/p>\n<h2>Deploy a Java native image on Azure<\/h2>\n<h3><span style=\"font-weight: 400;\">Build a container image<\/span><\/h3>\n<p>You can create a container image with a Quarkus native executable by following <span style=\"font-weight: 400;\"><a href=\"https:\/\/github.com\/Azure-Samples\/quarkus-native-telemetry\/blob\/main\/src\/main\/docker\/Dockerfile.native\">this Docker file example<\/a>.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Deploy the container image on Azure<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">You can now deploy the image to the Azure service of your choice: <\/span><a href=\"https:\/\/azure.microsoft.com\/products\/app-service\"><span style=\"font-weight: 400;\">Azure App Service<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/azure.microsoft.com\/products\/kubernetes-service\"><span style=\"font-weight: 400;\">Azure Kubernetes Service<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/azure.microsoft.com\/products\/container-apps\"><span style=\"font-weight: 400;\">Azure Container Apps<\/span><\/a><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/azure.microsoft.com\/products\/functions\"><span style=\"font-weight: 400;\">Azure Functions<\/span><\/a><span style=\"font-weight: 400;\">. You will need to set the APPLICATIONINSIGHTS_CONNECTION_STRING or the QUARKUS_OTEL_AZURE_APPLICATIONINSIGHTS_CONNECTION_STRING environment variable with the connections string value retrieved from the Azure environment. The <\/span><a href=\"https:\/\/docs.quarkiverse.io\/quarkus-opentelemetry-exporter\/dev\/quarkus-opentelemetry-exporter-azure.html\"><i><span style=\"font-weight: 400;\">quarkus-opentelemetry-exporter-azure<\/span><\/i><\/a><span style=\"font-weight: 400;\"> extension will work on all Azure services.<\/span><\/p>\n<p>You can find an example on how to deploy a Quarkus native image application on Azure Container Apps in <a href=\"https:\/\/github.com\/Azure-Samples\/java-native-telemetry\">this Github repository<\/a>.<\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">In this blog post we explain how to enable and send OpenTelemetry telemetry to Azure with a Quarkus native application. You can find the code for the blog post demo <\/span><a href=\"https:\/\/github.com\/Azure-Samples\/quarkus-native-telemetry\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">We look forward to hearing more of your feedback! <span class=\"TextRun SCXW79792443 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun Highlight SCXW79792443 BCX8\">Please\u202fdrop<\/span><span class=\"NormalTextRun Highlight SCXW79792443 BCX8\"> us a mail <\/span><span class=\"NormalTextRun Highlight SCXW79792443 BCX8\">at<\/span> <a href=\"mailto:JavaO11y@microsoft.com\">JavaO11y@microsoft.com<\/a> or<span class=\"NormalTextRun Highlight SCXW79792443 BCX8\">\u202f<\/span><\/span> <a class=\"Hyperlink TrackedChange TrackChangeHyperlinkInstruction SCXW79792443 BCX8\" href=\"https:\/\/github.com\/quarkiverse\/quarkus-opentelemetry-exporter\/issues\/new\" target=\"_blank\" rel=\"noreferrer noopener\"><span class=\"SCXW79792443 BCX8\"><span class=\"TrackChangeTextInsertion TrackedChange SCXW79792443 BCX8\"><span class=\"TextRun Underlined SCXW79792443 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun Highlight SCXW79792443 BCX8\" data-ccp-charstyle=\"Hyperlink\">create a GitHub issue<\/span><\/span><\/span><\/span><\/a><span class=\"TextRun SCXW79792443 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun Highlight SCXW79792443 BCX8\">.<\/span><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Quarkus is a general-purpose Java framework focused on efficient use of resources, fast startup, and rapid development. It allows developers to create and run services in the Java Virtual Machine (JVM) or native binary executables (native mode). In this blog post we are going to focus on using Quarkus to create and monitor a [&hellip;]<\/p>\n","protected":false},"author":138806,"featured_media":232185,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-232175","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"acf":[],"blog_post_summary":"<p>Introduction Quarkus is a general-purpose Java framework focused on efficient use of resources, fast startup, and rapid development. It allows developers to create and run services in the Java Virtual Machine (JVM) or native binary executables (native mode). In this blog post we are going to focus on using Quarkus to create and monitor a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/232175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/138806"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=232175"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/232175\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/232185"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=232175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=232175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=232175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}