{"id":20692,"date":"2023-02-08T13:24:07","date_gmt":"2023-02-08T12:24:07","guid":{"rendered":"https:\/\/blog.trifork.com\/?p=20692"},"modified":"2023-07-17T14:47:09","modified_gmt":"2023-07-17T12:47:09","slug":"micrometer-based-observability","status":"publish","type":"post","link":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/","title":{"rendered":"Spring Update #3 &#8211; We Shall See: Micrometer-based Observability"},"content":{"rendered":"\n<p>At the end of 2022, the Spring teams unveiled versions 6 &amp; 3 of the Spring Framework and Spring Boot, respectively. Along with this significant development came Micrometer-based Observability &#8211; a feature that enables better monitoring capabilities for cloud-native applications.<br><\/p>\n\n\n\n<p>In this edition of my 4 part blog series, which highlights the most important updates from the new releases, I will discuss Micrometer-based Observability in more detail.<br><\/p>\n\n\n\n<p>Check out my two previous blog posts in this series: &#8220;<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/blog.trifork.com\/2023\/01\/11\/new-baselines-java-17-and-jakarta-ee\/\" target=\"_blank\">New Baselines: Java 17 and Jakarta EE<\/a>&#8221; &amp; &#8220;<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/blog.trifork.com\/2023\/03\/08\/aot-and-native-compilation\/\" target=\"_blank\">AOT and Native Compilation<\/a>&#8221; if you haven\u2019t already<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>We Shall See: Micrometer-based Observability<\/strong><br><\/h3>\n\n\n\n<p>Spring Boot has been providing support for producing metrics in its 2.x-series for quite some time already via <a rel=\"noreferrer noopener\" aria-label=\"Micrometer (opens in a new tab)\" href=\"https:\/\/micrometer.io\" target=\"_blank\">Micrometer<\/a>. The Actuator module instruments various Spring components, like the web frameworks, and Micrometer makes the resulting metrics available to observability tools like Prometheus or Datadog.<\/p>\n\n\n\n<p>To support distributed tracing, Spring Cloud Sleuth is provided: a framework that uses <a rel=\"noreferrer noopener\" aria-label=\"OpenZipkin\u2019s Brave (opens in a new tab)\" href=\"https:\/\/github.com\/openzipkin\/brave\" target=\"_blank\">OpenZipkin\u2019s Brave<\/a>.<\/p>\n\n\n\n<p>Distributed tracing ensures that all services involved in handling a request share a common trace ID for logging, so that that can be correlated. Traces consist of one or more <em>spans<\/em>, which if so desired can also be exported to tools like OpenZipkin. That provides insight into the flow within a services architecture and especially into the bottlenecks within those flows.<\/p>\n\n\n\n<p>Sleuth is discontinued. As a replacement, the latest version of Micrometer contains a new abstraction for both metrics <em>and <\/em>tracing.&nbsp;<br><\/p>\n\n\n\n<p>Within Spring 6, this new micrometer-observation module is a direct dependency of components like spring-web and spring-rabbit. That means that there\u2019s now one single abstraction that can be used directly in Spring\u2019s codebase, rather than the Actuator- or Sleuth-code having to instrument that code from the outside. This provides a simpler, better and deeper integration than was possible in the old situation.<br><\/p>\n\n\n\n<p>As part of this abstraction, there\u2019s now the notion of low- and high-cardinality key-values. High-cardinality means that a key can have many different values. <br>Low cardinality keys will be used as both metrics and span tags, while high-cardinality keys are only used as span tags (used when exporting traces), to prevent your metric tags from getting out of hand.<\/p>\n\n\n\n<p>The new Micrometer also supports <a rel=\"noreferrer noopener\" aria-label=\"OpenTelemetry (opens in a new tab)\" href=\"https:\/\/opentelemetry.io\/\" target=\"_blank\">OpenTelemetry<\/a> next to OpenZipkin and by default uses <a rel=\"noreferrer noopener\" aria-label=\"W3C trace context propagation (opens in a new tab)\" href=\"https:\/\/www.w3.org\/TR\/trace-context\/\" target=\"_blank\">W3C trace context propagation<\/a> instead of OpenZipkin\u2019s <a rel=\"noreferrer noopener\" aria-label=\"B3 headers (opens in a new tab)\" href=\"https:\/\/github.com\/openzipkin\/b3-propagation\" target=\"_blank\">B3 headers<\/a>. <br>In practice this means that requests and messages will now contain a \u201ctraceparent\u201d header, and its value includes a 32-characters long trace ID; Brave would use a 16-character trace ID by default when using Spring Cloud Sleuth. Make sure to take this into account when you have clients and\/or backends expecting the old b3 header!<\/p>\n\n\n\n<p>All in all this is a huge step forward in supporting observability as a first class citizen in the Spring ecosystem: hopefully all other Spring projects will receive support for this new observability solution soon as well.<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Final Remark<\/strong><br><\/h3>\n\n\n\n<p>The new Micrometer-based observability solution in Spring 6 is a significant step forward in providing better support for metrics and distributed tracing. It offers deeper integration with existing framework components and supports OpenTelemetry and W3C trace context propagation, making it a powerful tool for gaining visibility into service architectures<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the end of 2022, the Spring teams unveiled versions 6 &amp; 3 of the Spring Framework and Spring Boot, respectively. Along with this significant development came Micrometer-based Observability &#8211; a feature that enables better monitoring capabilities for cloud-native applications. In this edition of my 4 part blog series, which highlights the most important updates [&hellip;]<\/p>\n","protected":false},"author":62,"featured_media":20690,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[10,94],"tags":[],"class_list":["post-20692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","category-spring"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring Update #3 - We Shall See: Micrometer-based Observability - Trifork Blog<\/title>\n<meta name=\"description\" content=\"In this article, I explore Micrometer-based Observability - a feature introduced at the end of 2022 with the new Spring releases that enables better monitoring capabilities for cloud-native applications.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Update #3 - We Shall See: Micrometer-based Observability - Trifork Blog\" \/>\n<meta property=\"og:description\" content=\"In this article, I explore Micrometer-based Observability - a feature introduced at the end of 2022 with the new Spring releases that enables better monitoring capabilities for cloud-native applications.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/\" \/>\n<meta property=\"og:site_name\" content=\"Trifork Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-08T12:24:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-17T12:47:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png\" \/>\n\t<meta property=\"og:image:width\" content=\"751\" \/>\n\t<meta property=\"og:image:height\" content=\"230\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joris Kuipers\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joris Kuipers\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/\",\"url\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/\",\"name\":\"Spring Update #3 - We Shall See: Micrometer-based Observability - Trifork Blog\",\"isPartOf\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png\",\"datePublished\":\"2023-02-08T12:24:07+00:00\",\"dateModified\":\"2023-07-17T12:47:09+00:00\",\"author\":{\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/265bd41e503f7176742258a927de598b\"},\"description\":\"In this article, I explore Micrometer-based Observability - a feature introduced at the end of 2022 with the new Spring releases that enables better monitoring capabilities for cloud-native applications.\",\"breadcrumb\":{\"@id\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#primaryimage\",\"url\":\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png\",\"contentUrl\":\"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png\",\"width\":751,\"height\":230},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trifork.nl\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Update #3 &#8211; We Shall See: Micrometer-based Observability\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trifork.nl\/blog\/#website\",\"url\":\"https:\/\/trifork.nl\/blog\/\",\"name\":\"Trifork Blog\",\"description\":\"Keep updated on the technical solutions Trifork is working on!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trifork.nl\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/265bd41e503f7176742258a927de598b\",\"name\":\"Joris Kuipers\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9ab8da0d60582bad84342d4602d23dbd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9ab8da0d60582bad84342d4602d23dbd?s=96&d=mm&r=g\",\"caption\":\"Joris Kuipers\"},\"sameAs\":[\"http:\/\/www.trifork.nl\"],\"url\":\"https:\/\/trifork.nl\/blog\/author\/jorisk\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Update #3 - We Shall See: Micrometer-based Observability - Trifork Blog","description":"In this article, I explore Micrometer-based Observability - a feature introduced at the end of 2022 with the new Spring releases that enables better monitoring capabilities for cloud-native applications.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/","og_locale":"en_US","og_type":"article","og_title":"Spring Update #3 - We Shall See: Micrometer-based Observability - Trifork Blog","og_description":"In this article, I explore Micrometer-based Observability - a feature introduced at the end of 2022 with the new Spring releases that enables better monitoring capabilities for cloud-native applications.","og_url":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/","og_site_name":"Trifork Blog","article_published_time":"2023-02-08T12:24:07+00:00","article_modified_time":"2023-07-17T12:47:09+00:00","og_image":[{"width":751,"height":230,"url":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png","type":"image\/png"}],"author":"Joris Kuipers","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Joris Kuipers","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/","url":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/","name":"Spring Update #3 - We Shall See: Micrometer-based Observability - Trifork Blog","isPartOf":{"@id":"https:\/\/trifork.nl\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#primaryimage"},"image":{"@id":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#primaryimage"},"thumbnailUrl":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png","datePublished":"2023-02-08T12:24:07+00:00","dateModified":"2023-07-17T12:47:09+00:00","author":{"@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/265bd41e503f7176742258a927de598b"},"description":"In this article, I explore Micrometer-based Observability - a feature introduced at the end of 2022 with the new Spring releases that enables better monitoring capabilities for cloud-native applications.","breadcrumb":{"@id":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trifork.nl\/blog\/micrometer-based-observability\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#primaryimage","url":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png","contentUrl":"https:\/\/trifork.nl\/blog\/wp-content\/uploads\/sites\/3\/2023\/01\/Nurture-Email-Trifork-Academy-Example-5.png","width":751,"height":230},{"@type":"BreadcrumbList","@id":"https:\/\/trifork.nl\/blog\/micrometer-based-observability\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trifork.nl\/blog\/"},{"@type":"ListItem","position":2,"name":"Spring Update #3 &#8211; We Shall See: Micrometer-based Observability"}]},{"@type":"WebSite","@id":"https:\/\/trifork.nl\/blog\/#website","url":"https:\/\/trifork.nl\/blog\/","name":"Trifork Blog","description":"Keep updated on the technical solutions Trifork is working on!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trifork.nl\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/265bd41e503f7176742258a927de598b","name":"Joris Kuipers","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trifork.nl\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9ab8da0d60582bad84342d4602d23dbd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9ab8da0d60582bad84342d4602d23dbd?s=96&d=mm&r=g","caption":"Joris Kuipers"},"sameAs":["http:\/\/www.trifork.nl"],"url":"https:\/\/trifork.nl\/blog\/author\/jorisk\/"}]}},"_links":{"self":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/20692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/comments?post=20692"}],"version-history":[{"count":1,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/20692\/revisions"}],"predecessor-version":[{"id":20804,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/posts\/20692\/revisions\/20804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media\/20690"}],"wp:attachment":[{"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/media?parent=20692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/categories?post=20692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trifork.nl\/blog\/wp-json\/wp\/v2\/tags?post=20692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}