{"id":529,"date":"2026-08-08T05:55:00","date_gmt":"2026-08-08T05:55:00","guid":{"rendered":"https:\/\/harshad-sonawane.com\/blog\/?p=529"},"modified":"2026-07-19T10:18:53","modified_gmt":"2026-07-19T10:18:53","slug":"spring-boot-observability-opentelemetry-collector","status":"publish","type":"post","link":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/","title":{"rendered":"Spring Boot Observability: Metrics, Traces &amp; Logs with OpenTelemetry Collector"},"content":{"rendered":"<p data-start=\"82\" data-end=\"414\">Modern <a href=\"https:\/\/harshad-sonawane.com\/blog\/eventual-consistency-distributed-java-systems\/\">distributed systems<\/a> are becoming increasingly complex. <a href=\"https:\/\/harshad-sonawane.com\/blog\/java-applications-edge-iot-architecture\/\">Microservices<\/a> communicate across networks, asynchronous event-driven workflows span multiple services, and cloud-native environments scale dynamically. In such architectures, traditional debugging methods like checking application logs manually are no longer sufficient.<\/p>\n<p data-start=\"416\" data-end=\"462\">This is where observability becomes essential.<\/p>\n<p data-start=\"464\" data-end=\"876\">Observability helps engineering teams understand the internal state of systems by analyzing telemetry data such as metrics, traces, and logs. Combined with <span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\"><a href=\"https:\/\/harshad-sonawane.com\/blog\/audit-logging-in-java-microservices-techniques-and-compliance-tips\/\">Spring Boot<\/a><\/span><\/span> and <span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">OpenTelemetry<\/span><\/span>, organizations can build highly observable systems capable of detecting performance bottlenecks, troubleshooting failures, and improving reliability in production environments.<\/p>\n<p data-start=\"878\" data-end=\"1092\">In this blog, we will explore how to implement end-to-end observability in Spring Boot applications using OpenTelemetry Collector, metrics, distributed tracing, centralized logging, <a href=\"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/\">Prometheus<\/a>, Grafana, and Jaeger.<\/p>\n<hr data-start=\"1094\" data-end=\"1097\" \/>\n<h1 data-section-id=\"1p3dg7o\" data-start=\"1099\" data-end=\"1123\">What is Observability?<\/h1>\n<p data-start=\"1125\" data-end=\"1261\">Observability refers to the ability to understand a system\u2019s behavior using telemetry data generated by applications and infrastructure.<\/p>\n<p data-start=\"1263\" data-end=\"1302\">The three pillars of observability are:<\/p>\n<ol data-start=\"1304\" data-end=\"1332\">\n<li data-section-id=\"m5qe19\" data-start=\"1304\" data-end=\"1314\">Metrics<\/li>\n<li data-section-id=\"14kt6jv\" data-start=\"1315\" data-end=\"1324\">Traces<\/li>\n<li data-section-id=\"1l5mnyn\" data-start=\"1325\" data-end=\"1332\">Logs<\/li>\n<\/ol>\n<p data-start=\"1334\" data-end=\"1422\">Together, these provide visibility into system performance, failures, and request flows.<\/p>\n<hr data-start=\"1424\" data-end=\"1427\" \/>\n<h1 data-section-id=\"zquqyd\" data-start=\"1429\" data-end=\"1456\">Why Observability Matters<\/h1>\n<p data-start=\"1458\" data-end=\"1514\">Modern applications face several operational challenges.<\/p>\n<h2 data-section-id=\"lusu4w\" data-start=\"1516\" data-end=\"1544\">Distributed Architectures<\/h2>\n<p data-start=\"1546\" data-end=\"1610\">Microservices communicate across multiple services and networks.<\/p>\n<h2 data-section-id=\"g5u26v\" data-start=\"1612\" data-end=\"1637\">Dynamic Infrastructure<\/h2>\n<p data-start=\"1639\" data-end=\"1697\">Containers and <a href=\"https:\/\/harshad-sonawane.com\/blog\/secrets-rotation-strategies-in-spring-boot-with-aws-gcp-azure\/\">Kubernetes<\/a> environments scale continuously.<\/p>\n<h2 data-section-id=\"jomrxt\" data-start=\"1699\" data-end=\"1728\">Asynchronous Communication<\/h2>\n<p data-start=\"1730\" data-end=\"1783\">Event-driven systems create non-linear request flows.<\/p>\n<h2 data-section-id=\"1r3bwig\" data-start=\"1785\" data-end=\"1809\">Faster Release Cycles<\/h2>\n<p data-start=\"1811\" data-end=\"1875\">Frequent deployments require rapid troubleshooting capabilities.<\/p>\n<p data-start=\"1877\" data-end=\"1957\">Without observability, diagnosing production issues becomes extremely difficult.<\/p>\n<hr data-start=\"1959\" data-end=\"1962\" \/>\n<h1 data-section-id=\"ru81v9\" data-start=\"1964\" data-end=\"1987\">Understanding Metrics<\/h1>\n<p data-start=\"1989\" data-end=\"2044\">Metrics are numerical measurements collected over time.<\/p>\n<p data-start=\"2046\" data-end=\"2063\">Examples include:<\/p>\n<ul data-start=\"2065\" data-end=\"2143\">\n<li data-section-id=\"6f65yj\" data-start=\"2065\" data-end=\"2076\">CPU usage<\/li>\n<li data-section-id=\"iefu4s\" data-start=\"2077\" data-end=\"2097\">Memory consumption<\/li>\n<li data-section-id=\"1x3lc3e\" data-start=\"2098\" data-end=\"2113\">Request count<\/li>\n<li data-section-id=\"4qp2qm\" data-start=\"2114\" data-end=\"2129\">Response time<\/li>\n<li data-section-id=\"zrx39d\" data-start=\"2130\" data-end=\"2143\">Error rates<\/li>\n<\/ul>\n<p data-start=\"2145\" data-end=\"2180\">Metrics help answer questions like:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>Is the application healthy?<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"2235\" data-end=\"2238\">or:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>Did latency increase after deployment?<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"2304\" data-end=\"2307\" \/>\n<h1 data-section-id=\"iellit\" data-start=\"2309\" data-end=\"2344\">Understanding Distributed Tracing<\/h1>\n<p data-start=\"2346\" data-end=\"2395\">Tracing tracks requests across multiple services.<\/p>\n<p data-start=\"2397\" data-end=\"2418\">Example request flow:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>Gateway \u2192 Order Service \u2192 Payment Service \u2192 Inventory Service<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"2507\" data-end=\"2530\">Tracing helps identify:<\/p>\n<ul data-start=\"2532\" data-end=\"2623\">\n<li data-section-id=\"kl83a9\" data-start=\"2532\" data-end=\"2547\">Slow services<\/li>\n<li data-section-id=\"bwc95u\" data-start=\"2548\" data-end=\"2569\">Network bottlenecks<\/li>\n<li data-section-id=\"12llg98\" data-start=\"2570\" data-end=\"2602\">Failed downstream dependencies<\/li>\n<li data-section-id=\"cg139o\" data-start=\"2603\" data-end=\"2623\">Cascading failures<\/li>\n<\/ul>\n<hr data-start=\"2625\" data-end=\"2628\" \/>\n<h1 data-section-id=\"1koefed\" data-start=\"2630\" data-end=\"2650\">Understanding Logs<\/h1>\n<p data-start=\"2652\" data-end=\"2698\">Logs provide detailed event-level information.<\/p>\n<p data-start=\"2700\" data-end=\"2709\">Examples:<\/p>\n<ul data-start=\"2711\" data-end=\"2777\">\n<li data-section-id=\"k3jqjw\" data-start=\"2711\" data-end=\"2723\">Exceptions<\/li>\n<li data-section-id=\"b2cnsh\" data-start=\"2724\" data-end=\"2741\">Business events<\/li>\n<li data-section-id=\"1nsvywe\" data-start=\"2742\" data-end=\"2760\">Audit activities<\/li>\n<li data-section-id=\"v08xnl\" data-start=\"2761\" data-end=\"2777\">Debug messages<\/li>\n<\/ul>\n<p data-start=\"2779\" data-end=\"2836\">Logs help investigate application-specific issues deeply.<\/p>\n<hr data-start=\"2838\" data-end=\"2841\" \/>\n<h1 data-section-id=\"10gtx8k\" data-start=\"2843\" data-end=\"2863\">Why OpenTelemetry?<\/h1>\n<p data-start=\"2865\" data-end=\"2982\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">OpenTelemetry<\/span><\/span> is the industry-standard observability framework for collecting telemetry data.<\/p>\n<p data-start=\"2984\" data-end=\"2996\">It supports:<\/p>\n<ul data-start=\"2998\" data-end=\"3093\">\n<li data-section-id=\"us86nz\" data-start=\"2998\" data-end=\"3007\">Metrics<\/li>\n<li data-section-id=\"5g2j4q\" data-start=\"3008\" data-end=\"3016\">Traces<\/li>\n<li data-section-id=\"1j3uj27\" data-start=\"3017\" data-end=\"3023\">Logs<\/li>\n<li data-section-id=\"r2qy1s\" data-start=\"3024\" data-end=\"3056\">Multiple programming languages<\/li>\n<li data-section-id=\"12n3tbe\" data-start=\"3057\" data-end=\"3093\">Vendor-neutral telemetry pipelines<\/li>\n<\/ul>\n<p data-start=\"3095\" data-end=\"3112\">Benefits include:<\/p>\n<ul data-start=\"3114\" data-end=\"3215\">\n<li data-section-id=\"1qrug1o\" data-start=\"3114\" data-end=\"3139\">Unified instrumentation<\/li>\n<li data-section-id=\"1dpu25q\" data-start=\"3140\" data-end=\"3164\">Standardized telemetry<\/li>\n<li data-section-id=\"19eela0\" data-start=\"3165\" data-end=\"3186\">Vendor independence<\/li>\n<li data-section-id=\"b4181n\" data-start=\"3187\" data-end=\"3215\">Cloud-native compatibility<\/li>\n<\/ul>\n<hr data-start=\"3217\" data-end=\"3220\" \/>\n<h1 data-section-id=\"1vxeoy9\" data-start=\"3222\" data-end=\"3256\">What is OpenTelemetry Collector?<\/h1>\n<p data-start=\"3258\" data-end=\"3327\">The OpenTelemetry Collector acts as a centralized telemetry pipeline.<\/p>\n<p data-start=\"3329\" data-end=\"3354\">Responsibilities include:<\/p>\n<ul data-start=\"3356\" data-end=\"3453\">\n<li data-section-id=\"mw2vk9\" data-start=\"3356\" data-end=\"3377\">Receiving telemetry<\/li>\n<li data-section-id=\"125127n\" data-start=\"3378\" data-end=\"3395\">Processing data<\/li>\n<li data-section-id=\"1mz6siv\" data-start=\"3396\" data-end=\"3417\">Filtering telemetry<\/li>\n<li data-section-id=\"1uyznh3\" data-start=\"3418\" data-end=\"3453\">Exporting to monitoring platforms<\/li>\n<\/ul>\n<p data-start=\"3455\" data-end=\"3558\">Instead of applications sending data directly to multiple tools, they send everything to the collector.<\/p>\n<hr data-start=\"3560\" data-end=\"3563\" \/>\n<h1 data-section-id=\"1c36pn\" data-start=\"3565\" data-end=\"3604\">High-Level Observability Architecture<\/h1>\n<p data-start=\"3606\" data-end=\"3666\">A modern Spring Boot observability stack typically includes:<\/p>\n<ol data-start=\"3668\" data-end=\"3805\">\n<li data-section-id=\"1y4nlk7\" data-start=\"3668\" data-end=\"3694\">Spring Boot Application<\/li>\n<li data-section-id=\"1ku6p9a\" data-start=\"3695\" data-end=\"3715\">OpenTelemetry SDK<\/li>\n<li data-section-id=\"15s42ww\" data-start=\"3716\" data-end=\"3742\">OpenTelemetry Collector<\/li>\n<li data-section-id=\"7hcxqd\" data-start=\"3743\" data-end=\"3756\">Prometheus<\/li>\n<li data-section-id=\"1y875du\" data-start=\"3757\" data-end=\"3767\">Grafana<\/li>\n<li data-section-id=\"fijxr7\" data-start=\"3768\" data-end=\"3777\">Jaeger<\/li>\n<li data-section-id=\"pktx3f\" data-start=\"3778\" data-end=\"3805\">Log Aggregation Platform<\/li>\n<\/ol>\n<hr data-start=\"3807\" data-end=\"3810\" \/>\n<h1 data-section-id=\"7qiefi\" data-start=\"3812\" data-end=\"3830\">Technology Stack<\/h1>\n<p data-start=\"3832\" data-end=\"3869\">For this implementation, we will use:<\/p>\n<ul data-start=\"3871\" data-end=\"4115\">\n<li data-section-id=\"2kc2rb\" data-start=\"3871\" data-end=\"3880\"><a href=\"https:\/\/harshad-sonawane.com\/blog\/reduce-cloud-costs-java-applications\/\">Java<\/a> 21<\/li>\n<li data-section-id=\"1etlrsl\" data-start=\"3881\" data-end=\"3920\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Spring Boot<\/span><\/span><\/li>\n<li data-section-id=\"1fetjdh\" data-start=\"3921\" data-end=\"3960\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">OpenTelemetry<\/span><\/span><\/li>\n<li data-section-id=\"16uh11\" data-start=\"3961\" data-end=\"4000\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Prometheus<\/span><\/span><\/li>\n<li data-section-id=\"btvcid\" data-start=\"4001\" data-end=\"4040\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Grafana<\/span><\/span><\/li>\n<li data-section-id=\"u21111\" data-start=\"4041\" data-end=\"4080\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Jaeger<\/span><\/span><\/li>\n<li data-section-id=\"1u6gra4\" data-start=\"4081\" data-end=\"4089\">Docker<\/li>\n<li data-section-id=\"1hb2fca\" data-start=\"4090\" data-end=\"4102\">Kubernetes<\/li>\n<li data-section-id=\"2pnjll\" data-start=\"4103\" data-end=\"4115\">Micrometer<\/li>\n<\/ul>\n<hr data-start=\"4117\" data-end=\"4120\" \/>\n<h1 data-section-id=\"1j6x7u1\" data-start=\"4122\" data-end=\"4155\">Adding Spring Boot Dependencies<\/h1>\n<h2 data-section-id=\"1o0f6m5\" data-start=\"4157\" data-end=\"4178\">Maven Dependencies<\/h2>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span class=\"\u037co\">&lt;dependencies&gt;<\/span>\n\n<span>    <\/span><span class=\"\u037co\">&lt;dependency&gt;<\/span>\n<span>        <\/span><span class=\"\u037co\">&lt;groupId&gt;<\/span><span>org.springframework.boot<\/span><span class=\"\u037co\">&lt;\/groupId&gt;<\/span>\n<span>        <\/span><span class=\"\u037co\">&lt;artifactId&gt;<\/span>\n<span>            spring-boot-starter-actuator<\/span>\n<span>        <\/span><span class=\"\u037co\">&lt;\/artifactId&gt;<\/span>\n<span>    <\/span><span class=\"\u037co\">&lt;\/dependency&gt;<\/span>\n\n<span>    <\/span><span class=\"\u037co\">&lt;dependency&gt;<\/span>\n<span>        <\/span><span class=\"\u037co\">&lt;groupId&gt;<\/span><span>io.micrometer<\/span><span class=\"\u037co\">&lt;\/groupId&gt;<\/span>\n<span>        <\/span><span class=\"\u037co\">&lt;artifactId&gt;<\/span>\n<span>            micrometer-registry-prometheus<\/span>\n<span>        <\/span><span class=\"\u037co\">&lt;\/artifactId&gt;<\/span>\n<span>    <\/span><span class=\"\u037co\">&lt;\/dependency&gt;<\/span>\n\n<span class=\"\u037co\">&lt;\/dependencies&gt;<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"4571\" data-end=\"4574\" \/>\n<h1 data-section-id=\"sh29im\" data-start=\"4576\" data-end=\"4607\">Enabling Spring Boot Actuator<\/h1>\n<p data-start=\"4609\" data-end=\"4672\">Spring Boot Actuator exposes operational metrics automatically.<\/p>\n<h2 data-section-id=\"1kmusxh\" data-start=\"4674\" data-end=\"4690\">Configuration<\/h2>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>management:<\/span>\n<span>  endpoints:<\/span>\n<span>    web:<\/span>\n<span>      exposure:<\/span>\n<span>        include: health,prometheus,metrics,info<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"4815\" data-end=\"4832\">Metrics endpoint:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>\/actuator\/prometheus<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"4880\" data-end=\"4883\" \/>\n<h1 data-section-id=\"1c2h9g5\" data-start=\"4885\" data-end=\"4923\">Configuring OpenTelemetry Java Agent<\/h1>\n<p data-start=\"4925\" data-end=\"5018\">The easiest way to instrument Spring Boot applications is using the OpenTelemetry Java agent.<\/p>\n<h2 data-section-id=\"1e32sg8\" data-start=\"5020\" data-end=\"5037\">Download Agent<\/h2>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>opentelemetry-javaagent.jar<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"5092\" data-end=\"5095\" \/>\n<h1 data-section-id=\"1pvfoal\" data-start=\"5097\" data-end=\"5129\">Running Spring Boot with Agent<\/h1>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>java <\/span><span class=\"\u037cn\">-javaagent<\/span><span>:opentelemetry-javaagent.jar \\<\/span>\n<span>     <\/span><span class=\"\u037cn\">-jar<\/span><span> app.jar<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"5220\" data-end=\"5223\" \/>\n<h1 data-section-id=\"7vf34g\" data-start=\"5225\" data-end=\"5256\">Setting Environment Variables<\/h1>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span class=\"\u037cg\">export<\/span><span> <\/span><span class=\"\u037cm\">OTEL_SERVICE_NAME<\/span><span class=\"\u037cg\">=<\/span><span>order-service<\/span>\n<span class=\"\u037cg\">export<\/span><span> <\/span><span class=\"\u037cm\">OTEL_EXPORTER_OTLP_ENDPOINT<\/span><span class=\"\u037cg\">=<\/span><span>http:\/\/localhost:4317<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"5379\" data-end=\"5382\" \/>\n<h1 data-section-id=\"1u1b7xv\" data-start=\"5384\" data-end=\"5411\">Automatic Instrumentation<\/h1>\n<p data-start=\"5413\" data-end=\"5454\">The Java agent automatically instruments:<\/p>\n<ul data-start=\"5456\" data-end=\"5552\">\n<li data-section-id=\"m45a1e\" data-start=\"5456\" data-end=\"5471\">HTTP requests<\/li>\n<li data-section-id=\"110voly\" data-start=\"5472\" data-end=\"5484\">JDBC calls<\/li>\n<li data-section-id=\"1e8dp8g\" data-start=\"5485\" data-end=\"5502\"><a href=\"https:\/\/harshad-sonawane.com\/blog\/building-real-time-applications-java-architecture-frameworks\/\">Kafka<\/a> messaging<\/li>\n<li data-section-id=\"179h5y9\" data-start=\"5503\" data-end=\"5510\">Redis<\/li>\n<li data-section-id=\"1p431j5\" data-start=\"5511\" data-end=\"5523\">Spring MVC<\/li>\n<li data-section-id=\"1sj2vc1\" data-start=\"5524\" data-end=\"5535\">WebClient<\/li>\n<li data-section-id=\"1emgynv\" data-start=\"5536\" data-end=\"5552\">REST templates<\/li>\n<\/ul>\n<p data-start=\"5554\" data-end=\"5583\">No code changes are required.<\/p>\n<hr data-start=\"5585\" data-end=\"5588\" \/>\n<h1 data-section-id=\"12ro11v\" data-start=\"5590\" data-end=\"5627\">Configuring OpenTelemetry Collector<\/h1>\n<p data-start=\"5629\" data-end=\"5685\">The collector receives telemetry data from applications.<\/p>\n<hr data-start=\"5687\" data-end=\"5690\" \/>\n<h1 data-section-id=\"1ua8mqd\" data-start=\"5692\" data-end=\"5717\">Collector Configuration<\/h1>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>receivers:<\/span>\n<span>  otlp:<\/span>\n<span>    protocols:<\/span>\n<span>      <a href=\"https:\/\/harshad-sonawane.com\/blog\/build-high-performance-java-apis-using-grpc\/\">grpc<\/a>:<\/span>\n<span>      http:<\/span>\n\n<span>exporters:<\/span>\n<span>  prometheus:<\/span>\n<span>    endpoint: <\/span><span class=\"\u037ck\">\"0.0.0.0:8889\"<\/span>\n\n<span>  jaeger:<\/span>\n<span>    endpoint: jaeger:14250<\/span>\n<span>    tls:<\/span>\n<span>      insecure: true<\/span>\n\n<span>service:<\/span>\n<span>  pipelines:<\/span>\n\n<span>    traces:<\/span>\n<span>      receivers: [otlp]<\/span>\n<span>      exporters: [jaeger]<\/span>\n\n<span>    metrics:<\/span>\n<span>      receivers: [otlp]<\/span>\n<span>      exporters: [prometheus]<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"6079\" data-end=\"6082\" \/>\n<h1 data-section-id=\"m1uu49\" data-start=\"6084\" data-end=\"6117\">Running OpenTelemetry Collector<\/h1>\n<p data-start=\"6119\" data-end=\"6134\">Docker example:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>docker run \\<\/span>\n<span>  <\/span><span class=\"\u037cn\">-p<\/span><span> <\/span><span class=\"\u037cj\">4317<\/span><span>:4317 \\<\/span>\n<span>  <\/span><span class=\"\u037cn\">-p<\/span><span> <\/span><span class=\"\u037cj\">8889<\/span><span>:8889 \\<\/span>\n<span>  otel\/opentelemetry-collector<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"6239\" data-end=\"6242\" \/>\n<h1 data-section-id=\"f6myiq\" data-start=\"6244\" data-end=\"6268\">Prometheus Integration<\/h1>\n<p data-start=\"6270\" data-end=\"6357\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Prometheus<\/span><\/span> scrapes metrics from the OpenTelemetry Collector.<\/p>\n<hr data-start=\"6359\" data-end=\"6362\" \/>\n<h1 data-section-id=\"1ae8w30\" data-start=\"6364\" data-end=\"6390\">Prometheus Configuration<\/h1>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>scrape_configs:<\/span>\n\n<span>  - job_name: <\/span><span class=\"\u037ck\">'otel-collector'<\/span>\n\n<span>    static_configs:<\/span>\n<span>      - targets: [<\/span><span class=\"\u037ck\">'otel-collector:8889'<\/span><span>]<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"6527\" data-end=\"6530\" \/>\n<h1 data-section-id=\"1tvyd9p\" data-start=\"6532\" data-end=\"6552\">Grafana Dashboards<\/h1>\n<p data-start=\"6554\" data-end=\"6618\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Grafana<\/span><\/span> visualizes telemetry data.<\/p>\n<p data-start=\"6620\" data-end=\"6646\">Common dashboards include:<\/p>\n<ul data-start=\"6648\" data-end=\"6759\">\n<li data-section-id=\"sg84ql\" data-start=\"6648\" data-end=\"6666\"><a href=\"https:\/\/harshad-sonawane.com\/blog\/java-memory-management-heap-gc-best\/\">JVM<\/a> memory usage<\/li>\n<li data-section-id=\"107ia9d\" data-start=\"6667\" data-end=\"6684\">Request latency<\/li>\n<li data-section-id=\"g0hme2\" data-start=\"6685\" data-end=\"6701\">API throughput<\/li>\n<li data-section-id=\"zrx39d\" data-start=\"6702\" data-end=\"6715\">Error rates<\/li>\n<li data-section-id=\"beofv9\" data-start=\"6716\" data-end=\"6738\">Database performance<\/li>\n<li data-section-id=\"cod7oa\" data-start=\"6739\" data-end=\"6759\">Kafka consumer lag<\/li>\n<\/ul>\n<hr data-start=\"6761\" data-end=\"6764\" \/>\n<h1 data-section-id=\"16janjh\" data-start=\"6766\" data-end=\"6799\">Distributed Tracing with Jaeger<\/h1>\n<p data-start=\"6801\" data-end=\"6871\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Jaeger<\/span><\/span> visualizes distributed traces.<\/p>\n<p data-start=\"6873\" data-end=\"6892\">Example trace flow:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span><a href=\"https:\/\/harshad-sonawane.com\/blog\/migrating-monoliths-to-microservices-blueprint\/\">API Gateway<\/a><\/span>\n<span>   \u2193<\/span>\n<span>Order Service<\/span>\n<span>   \u2193<\/span>\n<span>Payment Service<\/span>\n<span>   \u2193<\/span>\n<span>Inventory Service<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"6994\" data-end=\"7027\">Each request receives a trace ID.<\/p>\n<hr data-start=\"7029\" data-end=\"7032\" \/>\n<h1 data-section-id=\"1klxk86\" data-start=\"7034\" data-end=\"7056\">Adding Custom Traces<\/h1>\n<p data-start=\"7058\" data-end=\"7097\">Custom spans help trace business logic.<\/p>\n<h2 data-section-id=\"1c54mul\" data-start=\"7099\" data-end=\"7109\">Example<\/h2>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span class=\"\u037cm\">Span<\/span><span> <\/span><span class=\"\u037cm\">span<\/span><span> <\/span><span class=\"\u037cg\">=<\/span><span> <\/span><span class=\"\u037cm\">tracer<\/span><span class=\"\u037cg\">.<\/span><span class=\"\u037cm\">spanBuilder<\/span><span>(<\/span><span class=\"\u037ck\">\"payment-processing\"<\/span><span>)<\/span>\n<span>                  <\/span><span class=\"\u037cg\">.<\/span><span class=\"\u037cm\">startSpan<\/span><span>();<\/span>\n\n<span class=\"\u037cg\">try<\/span><span> {<\/span>\n\n<span>    <\/span><span class=\"\u037cm\">processPayment<\/span><span>();<\/span>\n\n<span>} <\/span><span class=\"\u037cg\">finally<\/span><span> {<\/span>\n\n<span>    <\/span><span class=\"\u037cm\">span<\/span><span class=\"\u037cg\">.<\/span><span class=\"\u037cm\">end<\/span><span>();<\/span>\n<span>}<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"7283\" data-end=\"7286\" \/>\n<h1 data-section-id=\"184dx2s\" data-start=\"7288\" data-end=\"7308\">Structured Logging<\/h1>\n<p data-start=\"7310\" data-end=\"7361\">Logs become more powerful when structured properly.<\/p>\n<p data-start=\"7363\" data-end=\"7382\">Recommended format:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>{<\/span>\n<span>  \"timestamp\": <\/span><span class=\"\u037ck\">\"2026-05-17T10:00:00\"<\/span><span>,<\/span>\n<span>  \"traceId\": <\/span><span class=\"\u037ck\">\"abc123\"<\/span><span>,<\/span>\n<span>  \"service\": <\/span><span class=\"\u037ck\">\"order-service\"<\/span><span>,<\/span>\n<span>  \"message\": <\/span><span class=\"\u037ck\">\"Payment successful\"<\/span>\n<span>}<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"7538\" data-end=\"7541\" \/>\n<h1 data-section-id=\"28skmw\" data-start=\"7543\" data-end=\"7572\">Correlating Logs and Traces<\/h1>\n<p data-start=\"7574\" data-end=\"7600\">Include trace IDs in logs.<\/p>\n<p data-start=\"7602\" data-end=\"7611\">Benefits:<\/p>\n<ul data-start=\"7613\" data-end=\"7692\">\n<li data-section-id=\"19fuey1\" data-start=\"7613\" data-end=\"7631\">Faster debugging<\/li>\n<li data-section-id=\"129bixw\" data-start=\"7632\" data-end=\"7663\">End-to-end request visibility<\/li>\n<li data-section-id=\"y97t2s\" data-start=\"7664\" data-end=\"7692\">Easier root cause analysis<\/li>\n<\/ul>\n<hr data-start=\"7694\" data-end=\"7697\" \/>\n<h1 data-section-id=\"5bq07i\" data-start=\"7699\" data-end=\"7716\">Log Aggregation<\/h1>\n<p data-start=\"7718\" data-end=\"7756\">Centralized logging platforms include:<\/p>\n<ul data-start=\"7758\" data-end=\"7850\">\n<li data-section-id=\"1flqygl\" data-start=\"7758\" data-end=\"7799\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Elasticsearch<\/span><\/span><\/li>\n<li data-section-id=\"rwywvp\" data-start=\"7800\" data-end=\"7841\"><span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Loki<\/span><\/span><\/li>\n<li data-section-id=\"633r7b\" data-start=\"7842\" data-end=\"7850\">Splunk<\/li>\n<\/ul>\n<hr data-start=\"7852\" data-end=\"7855\" \/>\n<h1 data-section-id=\"15797i1\" data-start=\"7857\" data-end=\"7883\">Kubernetes Observability<\/h1>\n<p data-start=\"7885\" data-end=\"7949\">Kubernetes environments require additional telemetry visibility.<\/p>\n<p data-start=\"7951\" data-end=\"7959\">Monitor:<\/p>\n<ul data-start=\"7961\" data-end=\"8035\">\n<li data-section-id=\"1q2pbkn\" data-start=\"7961\" data-end=\"7975\">Pod restarts<\/li>\n<li data-section-id=\"o1n553\" data-start=\"7976\" data-end=\"7997\">Node resource usage<\/li>\n<li data-section-id=\"1xzdfby\" data-start=\"7998\" data-end=\"8015\">Network latency<\/li>\n<li data-section-id=\"1ioudg2\" data-start=\"8016\" data-end=\"8035\">Container crashes<\/li>\n<\/ul>\n<hr data-start=\"8037\" data-end=\"8040\" \/>\n<h1 data-section-id=\"1omer3s\" data-start=\"8042\" data-end=\"8071\">OpenTelemetry in Kubernetes<\/h1>\n<p data-start=\"8073\" data-end=\"8102\">Collector deployment example:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute inset-x-4 top-12 bottom-4\">\n<div class=\"pointer-events-none sticky z-40 shrink-0 z-1!\">\n<div class=\"sticky bg-token-border-light\"><\/div>\n<\/div>\n<\/div>\n<div class=\"relative\">\n<div class=\"\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>apiVersion: apps\/v1<\/span>\n<span>kind: Deployment<\/span>\n\n<span>metadata:<\/span>\n<span>  name: otel-collector<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"8200\" data-end=\"8203\" \/>\n<h1 data-section-id=\"1n3gp4p\" data-start=\"8205\" data-end=\"8229\">Metrics Best Practices<\/h1>\n<h2 data-section-id=\"ib9qtg\" data-start=\"8231\" data-end=\"8256\">Avoid High Cardinality<\/h2>\n<p data-start=\"8258\" data-end=\"8270\">Bad example:<\/p>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>userId as metric label<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"8320\" data-end=\"8356\">This creates excessive memory usage.<\/p>\n<hr data-start=\"8358\" data-end=\"8361\" \/>\n<h1 data-section-id=\"hlax4a\" data-start=\"8363\" data-end=\"8387\">Use Meaningful Metrics<\/h1>\n<p data-start=\"8389\" data-end=\"8403\">Good examples:<\/p>\n<ul data-start=\"8405\" data-end=\"8455\">\n<li data-section-id=\"nlmq1a\" data-start=\"8405\" data-end=\"8422\">request_latency<\/li>\n<li data-section-id=\"h684xl\" data-start=\"8423\" data-end=\"8437\">active_users<\/li>\n<li data-section-id=\"1onyswt\" data-start=\"8438\" data-end=\"8455\">failed_payments<\/li>\n<\/ul>\n<hr data-start=\"8457\" data-end=\"8460\" \/>\n<h1 data-section-id=\"1cmrb8q\" data-start=\"8462\" data-end=\"8486\">Tracing Best Practices<\/h1>\n<h2 data-section-id=\"1e6gppt\" data-start=\"8488\" data-end=\"8511\">Trace Critical Paths<\/h2>\n<p data-start=\"8513\" data-end=\"8550\">Focus on business-critical workflows.<\/p>\n<h2 data-section-id=\"1pwxdke\" data-start=\"8552\" data-end=\"8576\">Avoid Excessive Spans<\/h2>\n<p data-start=\"8578\" data-end=\"8611\">Too many spans increase overhead.<\/p>\n<h2 data-section-id=\"1r1dh2m\" data-start=\"8613\" data-end=\"8639\">Sample Traces Carefully<\/h2>\n<p data-start=\"8641\" data-end=\"8680\">Production systems should use sampling.<\/p>\n<hr data-start=\"8682\" data-end=\"8685\" \/>\n<h1 data-section-id=\"1u6i5f1\" data-start=\"8687\" data-end=\"8711\">Logging Best Practices<\/h1>\n<h2 data-section-id=\"19gyq6w\" data-start=\"8713\" data-end=\"8740\">Use Structured JSON Logs<\/h2>\n<p data-start=\"8742\" data-end=\"8764\">Avoid plain text logs.<\/p>\n<h2 data-section-id=\"hnuo3w\" data-start=\"8766\" data-end=\"8789\">Avoid Sensitive Data<\/h2>\n<p data-start=\"8791\" data-end=\"8801\">Never log:<\/p>\n<ul data-start=\"8803\" data-end=\"8834\">\n<li data-section-id=\"do785g\" data-start=\"8803\" data-end=\"8814\">Passwords<\/li>\n<li data-section-id=\"5ibq1s\" data-start=\"8815\" data-end=\"8823\">Tokens<\/li>\n<li data-section-id=\"1cgd0gk\" data-start=\"8824\" data-end=\"8834\">API keys<\/li>\n<\/ul>\n<h2 data-section-id=\"14xtmks\" data-start=\"8836\" data-end=\"8863\">Use Log Levels Correctly<\/h2>\n<ul data-start=\"8865\" data-end=\"8942\">\n<li data-section-id=\"3mcy1w\" data-start=\"8865\" data-end=\"8891\">INFO for business events<\/li>\n<li data-section-id=\"9jmmo3\" data-start=\"8892\" data-end=\"8921\">WARN for recoverable issues<\/li>\n<li data-section-id=\"supcd4\" data-start=\"8922\" data-end=\"8942\">ERROR for failures<\/li>\n<\/ul>\n<hr data-start=\"8944\" data-end=\"8947\" \/>\n<h1 data-section-id=\"ib32zr\" data-start=\"8949\" data-end=\"8975\">Monitoring SLIs and SLOs<\/h1>\n<p data-start=\"8977\" data-end=\"9037\">Modern observability focuses heavily on reliability metrics.<\/p>\n<p data-start=\"9039\" data-end=\"9048\">Examples:<\/p>\n<h2 data-section-id=\"1iz6oo\" data-start=\"9050\" data-end=\"9082\">Service Level Indicator (SLI)<\/h2>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>99.95% successful requests<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2 data-section-id=\"4abcuo\" data-start=\"9136\" data-end=\"9168\">Service Level Objective (SLO)<\/h2>\n<div class=\"relative w-full mt-4 mb-1\">\n<div class=\"\">\n<div class=\"relative\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"h-full min-h-0 min-w-0\">\n<div class=\"border border-token-border-light border-radius-3xl corner-superellipse\/1.1 rounded-3xl\">\n<div class=\"h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse\/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback\">\n<div class=\"pointer-events-none absolute end-1.5 top-1 z-2 md:end-2 md:top-1\"><\/div>\n<div class=\"relative\">\n<div class=\"pe-11 pt-3\">\n<div class=\"relative z-0 flex max-w-full\">\n<div id=\"code-block-viewer\" dir=\"ltr\" class=\"q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch \u037cd \u037cr\">\n<div class=\"cm-scroller\">\n<pre class=\"cm-content q9tKkq_readonly m-0\"><code><span>API latency below 200ms<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"\">\n<div class=\"\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"9219\" data-end=\"9222\" \/>\n<h1 data-section-id=\"1euycjq\" data-start=\"9224\" data-end=\"9257\">Common Observability Challenges<\/h1>\n<hr data-start=\"9259\" data-end=\"9262\" \/>\n<h1 data-section-id=\"daxr9d\" data-start=\"9264\" data-end=\"9284\">Telemetry Overload<\/h1>\n<p data-start=\"9286\" data-end=\"9336\">Excessive metrics and logs increase storage costs.<\/p>\n<hr data-start=\"9338\" data-end=\"9341\" \/>\n<h1 data-section-id=\"1huoyxm\" data-start=\"9343\" data-end=\"9364\">Missing Correlation<\/h1>\n<p data-start=\"9366\" data-end=\"9414\">Without trace IDs, debugging becomes fragmented.<\/p>\n<hr data-start=\"9416\" data-end=\"9419\" \/>\n<h1 data-section-id=\"ogpui1\" data-start=\"9421\" data-end=\"9441\">High Storage Costs<\/h1>\n<p data-start=\"9443\" data-end=\"9490\">Logs and traces scale rapidly in large systems.<\/p>\n<hr data-start=\"9492\" data-end=\"9495\" \/>\n<h1 data-section-id=\"1va49y9\" data-start=\"9497\" data-end=\"9518\">Sampling Complexity<\/h1>\n<p data-start=\"9520\" data-end=\"9563\">Improper sampling may hide critical issues.<\/p>\n<hr data-start=\"9565\" data-end=\"9568\" \/>\n<h1 data-section-id=\"r3abud\" data-start=\"9570\" data-end=\"9595\">Security Considerations<\/h1>\n<p data-start=\"9597\" data-end=\"9643\">Observability systems must also remain secure.<\/p>\n<p data-start=\"9645\" data-end=\"9665\">Important practices:<\/p>\n<ul data-start=\"9667\" data-end=\"9785\">\n<li data-section-id=\"3dukdp\" data-start=\"9667\" data-end=\"9694\">Encrypt telemetry traffic<\/li>\n<li data-section-id=\"47re6s\" data-start=\"9695\" data-end=\"9722\">Restrict dashboard access<\/li>\n<li data-section-id=\"19xc05j\" data-start=\"9723\" data-end=\"9744\">Mask sensitive logs<\/li>\n<li data-section-id=\"1ay9h8a\" data-start=\"9745\" data-end=\"9766\">Apply RBAC controls<\/li>\n<li data-section-id=\"1hft64f\" data-start=\"9767\" data-end=\"9785\">Secure exporters<\/li>\n<\/ul>\n<hr data-start=\"9787\" data-end=\"9790\" \/>\n<h1 data-section-id=\"d96wq5\" data-start=\"9792\" data-end=\"9819\">Production Best Practices<\/h1>\n<h2 data-section-id=\"qbilrd\" data-start=\"9821\" data-end=\"9855\">Centralize Telemetry Collection<\/h2>\n<p data-start=\"9857\" data-end=\"9901\">Avoid direct application-to-vendor coupling.<\/p>\n<h2 data-section-id=\"a4dgnr\" data-start=\"9903\" data-end=\"9935\">Standardize Telemetry Formats<\/h2>\n<p data-start=\"9937\" data-end=\"9980\">Use OpenTelemetry conventions consistently.<\/p>\n<h2 data-section-id=\"sb68cy\" data-start=\"9982\" data-end=\"10013\">Monitor the Monitoring Stack<\/h2>\n<p data-start=\"10015\" data-end=\"10071\">Observability infrastructure itself requires monitoring.<\/p>\n<h2 data-section-id=\"1w39ube\" data-start=\"10073\" data-end=\"10107\">Automate Dashboard Provisioning<\/h2>\n<p data-start=\"10109\" data-end=\"10162\">Use Infrastructure as Code for dashboards and alerts.<\/p>\n<hr data-start=\"10164\" data-end=\"10167\" \/>\n<h1 data-section-id=\"1m0xw92\" data-start=\"10169\" data-end=\"10216\">When Should You Implement Full Observability?<\/h1>\n<p data-start=\"10218\" data-end=\"10269\">Comprehensive observability becomes essential when:<\/p>\n<ul data-start=\"10271\" data-end=\"10430\">\n<li data-section-id=\"4z6rqu\" data-start=\"10271\" data-end=\"10303\">Applications use microservices<\/li>\n<li data-section-id=\"1c72sqz\" data-start=\"10304\" data-end=\"10331\">Systems scale dynamically<\/li>\n<li data-section-id=\"1bzue8o\" data-start=\"10332\" data-end=\"10364\">Multiple teams share ownership<\/li>\n<li data-section-id=\"1qo70xw\" data-start=\"10365\" data-end=\"10396\"><a href=\"https:\/\/harshad-sonawane.com\/blog\/building-multi-region-spring-boot-systems-for-global-availability\/\">High availability<\/a> is required<\/li>\n<li data-section-id=\"818rrm\" data-start=\"10397\" data-end=\"10430\">Incident response speed matters<\/li>\n<\/ul>\n<hr data-start=\"10432\" data-end=\"10435\" \/>\n<h1 data-section-id=\"1329ug4\" data-start=\"10437\" data-end=\"10453\">Final Thoughts<\/h1>\n<p data-start=\"10455\" data-end=\"10746\">Observability has become a foundational requirement for modern cloud-native systems. Metrics alone are no longer sufficient for troubleshooting distributed architectures. Engineering teams need unified visibility into metrics, traces, and logs to understand application behavior effectively.<\/p>\n<p data-start=\"10748\" data-end=\"11010\">Using <span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">Spring Boot<\/span><\/span> together with <span class=\"hover:entity-accent entity-underline inline cursor-pointer align-baseline\"><span class=\"whitespace-normal\">OpenTelemetry<\/span><\/span> and the OpenTelemetry Collector enables organizations to build scalable, vendor-neutral observability pipelines capable of supporting complex distributed systems.<\/p>\n<p data-start=\"11012\" data-end=\"11179\">The key to successful observability implementation lies in standardization, trace correlation, centralized telemetry pipelines, and continuous monitoring improvements.<\/p>\n<hr \/>\n<h1 data-section-id=\"1glbcc5\" data-start=\"12159\" data-end=\"12175\">Reference URLs<\/h1>\n<ul data-start=\"12177\" data-end=\"12512\">\n<li data-section-id=\"5lr08l\" data-start=\"12177\" data-end=\"12218\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/spring.io\/projects\/spring-boot?utm_source=chatgpt.com\">Spring Boot Official Documentation<\/a><\/span><\/li>\n<li data-section-id=\"1gy30mt\" data-start=\"12219\" data-end=\"12260\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/opentelemetry.io\/docs\/?utm_source=chatgpt.com\">OpenTelemetry Documentation<\/a><\/span><\/li>\n<li data-section-id=\"1xou0z9\" data-start=\"12261\" data-end=\"12302\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/opentelemetry.io\/docs\/collector\/?utm_source=chatgpt.com\">OpenTelemetry Collector Documentation<\/a><\/span><\/li>\n<li data-section-id=\"13xodx1\" data-start=\"12303\" data-end=\"12344\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/prometheus.io\/docs\/introduction\/overview\/?utm_source=chatgpt.com\">Prometheus Documentation<\/a><\/span><\/li>\n<li data-section-id=\"1kofe9h\" data-start=\"12345\" data-end=\"12386\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/grafana.com\/docs\/?utm_source=chatgpt.com\">Grafana Documentation<\/a><\/span><\/li>\n<li data-section-id=\"iyyrp1\" data-start=\"12387\" data-end=\"12428\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/www.jaegertracing.io\/docs\/latest\/?utm_source=chatgpt.com\">Jaeger Documentation<\/a><\/span><\/li>\n<li data-section-id=\"1g79p11\" data-start=\"12429\" data-end=\"12470\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/micrometer.io\/docs?utm_source=chatgpt.com\">Micrometer Documentation<\/a><\/span><\/li>\n<li data-section-id=\"1ama111\" data-start=\"12471\" data-end=\"12512\"><span class=\"\" data-state=\"closed\"><a target=\"_blank\" class=\"decorated-link\" rel=\"noopener\" href=\"https:\/\/docs.spring.io\/spring-boot\/reference\/actuator\/index.html?utm_source=chatgpt.com\">Spring Boot Actuator Documentation<\/a><\/span><\/li>\n<\/ul>\n<hr \/>\n<p><\/p>\n\n\n<p class=\"o-typing-delay-100ms ticss-27f7e3e9 wp-block-paragraph\"><o-anim-typing>&lt;> <strong>&#8220;Happy developing, one line at a time!&#8221;<\/strong> &lt;\/><\/o-anim-typing><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modern distributed systems are becoming increasingly complex. Microservices communicate across networks, asynchronous event-driven workflows span multiple services, and cloud-native environments scale dynamically. In such architectures, traditional debugging methods like checking application logs manually are no longer sufficient. This is where observability becomes essential. Observability helps engineering teams understand the internal [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":535,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[113],"tags":[34,67,8,66,398,260,401,2,7,400,399,404,9,259,261,397,402,258,3,403],"class_list":["post-529","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-spring-boot-aws-microservices","tag-backend-development","tag-cloud-native","tag-devops","tag-distributed-systems","tag-distributed-tracing","tag-grafana","tag-jaeger","tag-java","tag-kubernetes","tag-logs","tag-metrics","tag-micrometer","tag-microservices","tag-monitoring","tag-observability","tag-opentelemetry","tag-opentelemetry-collector","tag-prometheus","tag-spring-boot","tag-structured-logging"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>pring Boot Observability with OpenTelemetry Collector<\/title>\n<meta name=\"description\" content=\"Learn how to implement observability in Spring Boot applications using OpenTelemetry Collector, Prometheus, Grafana, Jaeger, metrics, distributed tracing, and centralized logging for cloud-native microservices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"pring Boot Observability with OpenTelemetry Collector\" \/>\n<meta property=\"og:description\" content=\"Learn how to implement observability in Spring Boot applications using OpenTelemetry Collector, Prometheus, Grafana, Jaeger, metrics, distributed tracing, and centralized logging for cloud-native microservices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/\" \/>\n<meta property=\"og:site_name\" content=\"&lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-08T05:55:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-May-17-2026-11_39_40-AM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"HS\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"HS\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/\"},\"author\":{\"name\":\"HS\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"headline\":\"Spring Boot Observability: Metrics, Traces &amp; Logs with OpenTelemetry Collector\",\"datePublished\":\"2026-08-08T05:55:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/\"},\"wordCount\":954,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"image\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-May-17-2026-11_39_40-AM.png\",\"keywords\":[\"Backend Development\",\"Cloud Native\",\"DevOps\",\"Distributed Systems\",\"Distributed Tracing\",\"Grafana\",\"Jaeger\",\"Java\",\"Kubernetes\",\"Logs\",\"Metrics\",\"Micrometer\",\"Microservices\",\"Monitoring\",\"Observability\",\"OpenTelemetry\",\"OpenTelemetry Collector\",\"Prometheus\",\"Spring Boot\",\"Structured Logging\"],\"articleSection\":[\"Java, Spring Boot, AWS, Microservices\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/\",\"name\":\"pring Boot Observability with OpenTelemetry Collector\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-May-17-2026-11_39_40-AM.png\",\"datePublished\":\"2026-08-08T05:55:00+00:00\",\"description\":\"Learn how to implement observability in Spring Boot applications using OpenTelemetry Collector, Prometheus, Grafana, Jaeger, metrics, distributed tracing, and centralized logging for cloud-native microservices.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#primaryimage\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-May-17-2026-11_39_40-AM.png\",\"contentUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/ChatGPT-Image-May-17-2026-11_39_40-AM.png\",\"width\":1536,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/spring-boot-observability-opentelemetry-collector\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Boot Observability: Metrics, Traces &amp; Logs with OpenTelemetry Collector\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/\",\"name\":\"Harshad's Dev Diary\",\"description\":\"HARSHAD&#039;s Dev Diary\",\"publisher\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\",\"name\":\"HS\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\",\"contentUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\",\"width\":400,\"height\":400,\"caption\":\"HS\"},\"logo\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/about.jpg\"},\"sameAs\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\"],\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"pring Boot Observability with OpenTelemetry Collector","description":"Learn how to implement observability in Spring Boot applications using OpenTelemetry Collector, Prometheus, Grafana, Jaeger, metrics, distributed tracing, and centralized logging for cloud-native microservices.","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:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/","og_locale":"en_US","og_type":"article","og_title":"pring Boot Observability with OpenTelemetry Collector","og_description":"Learn how to implement observability in Spring Boot applications using OpenTelemetry Collector, Prometheus, Grafana, Jaeger, metrics, distributed tracing, and centralized logging for cloud-native microservices.","og_url":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/","og_site_name":"&lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","article_published_time":"2026-08-08T05:55:00+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-May-17-2026-11_39_40-AM.png","type":"image\/png"}],"author":"HS","twitter_card":"summary_large_image","twitter_misc":{"Written by":"HS","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#article","isPartOf":{"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/"},"author":{"name":"HS","@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"headline":"Spring Boot Observability: Metrics, Traces &amp; Logs with OpenTelemetry Collector","datePublished":"2026-08-08T05:55:00+00:00","mainEntityOfPage":{"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/"},"wordCount":954,"commentCount":0,"publisher":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"image":{"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#primaryimage"},"thumbnailUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-May-17-2026-11_39_40-AM.png","keywords":["Backend Development","Cloud Native","DevOps","Distributed Systems","Distributed Tracing","Grafana","Jaeger","Java","Kubernetes","Logs","Metrics","Micrometer","Microservices","Monitoring","Observability","OpenTelemetry","OpenTelemetry Collector","Prometheus","Spring Boot","Structured Logging"],"articleSection":["Java, Spring Boot, AWS, Microservices"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/","url":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/","name":"pring Boot Observability with OpenTelemetry Collector","isPartOf":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#primaryimage"},"image":{"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#primaryimage"},"thumbnailUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-May-17-2026-11_39_40-AM.png","datePublished":"2026-08-08T05:55:00+00:00","description":"Learn how to implement observability in Spring Boot applications using OpenTelemetry Collector, Prometheus, Grafana, Jaeger, metrics, distributed tracing, and centralized logging for cloud-native microservices.","breadcrumb":{"@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#primaryimage","url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-May-17-2026-11_39_40-AM.png","contentUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2026\/08\/ChatGPT-Image-May-17-2026-11_39_40-AM.png","width":1536,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/harshad-sonawane.com\/blog\/spring-boot-observability-opentelemetry-collector\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/harshad-sonawane.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Spring Boot Observability: Metrics, Traces &amp; Logs with OpenTelemetry Collector"}]},{"@type":"WebSite","@id":"https:\/\/harshad-sonawane.com\/blog\/#website","url":"https:\/\/harshad-sonawane.com\/blog\/","name":"Harshad's Dev Diary","description":"HARSHAD&#039;s Dev Diary","publisher":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/harshad-sonawane.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e","name":"HS","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg","url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg","contentUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg","width":400,"height":400,"caption":"HS"},"logo":{"@id":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/02\/about.jpg"},"sameAs":["https:\/\/harshad-sonawane.com\/blog"],"url":"https:\/\/harshad-sonawane.com\/blog\/author\/admin\/"}]}},"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/comments?post=529"}],"version-history":[{"count":3,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/529\/revisions"}],"predecessor-version":[{"id":534,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/529\/revisions\/534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/media\/535"}],"wp:attachment":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/media?parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/categories?post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/tags?post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}