{"id":305,"date":"2025-11-15T05:55:00","date_gmt":"2025-11-15T05:55:00","guid":{"rendered":"https:\/\/harshad-sonawane.com\/blog\/?p=305"},"modified":"2025-10-25T17:32:24","modified_gmt":"2025-10-25T17:32:24","slug":"monitoring-java-applications-prometheus-grafana-kubernetes","status":"publish","type":"post","link":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/","title":{"rendered":"Monitoring Java Applications with Prometheus and Grafana on Kubernetes"},"content":{"rendered":"<h2 data-start=\"458\" data-end=\"473\">Introduction<\/h2>\n<p data-start=\"474\" data-end=\"884\">Modern microservices-based architectures rely heavily on observability to ensure applications perform reliably at scale.<br data-start=\"594\" data-end=\"597\" \/>For <a href=\"https:\/\/harshad-sonawane.com\/blog\/reduce-cloud-costs-java-applications\/\">Java<\/a> applications running on Kubernetes, <strong data-start=\"642\" data-end=\"656\">Prometheus<\/strong> and <strong data-start=\"661\" data-end=\"672\">Grafana<\/strong> are the standard tools for monitoring and visualization. Together, they offer a flexible system for collecting, storing, and analyzing metrics \u2014 allowing developers to detect issues before they affect end users.<\/p>\n<p data-start=\"886\" data-end=\"1079\">This guide explains how to monitor Java applications on Kubernetes using Prometheus for metrics collection and Grafana for visualization, with hands-on steps, code examples, and best practices.<\/p>\n<hr data-start=\"1081\" data-end=\"1084\" \/>\n<h2 data-start=\"1086\" data-end=\"1138\">Why Monitoring Matters in Kubernetes Environments<\/h2>\n<p data-start=\"1139\" data-end=\"1327\">Kubernetes introduces dynamic scaling, service discovery, and container orchestration \u2014 which complicate monitoring. Traditional APM tools struggle with ephemeral pods and rolling updates.<\/p>\n<p data-start=\"1329\" data-end=\"1363\"><strong data-start=\"1329\" data-end=\"1363\">Effective monitoring helps to:<\/strong><\/p>\n<ul data-start=\"1364\" data-end=\"1538\">\n<li data-start=\"1364\" data-end=\"1397\">\n<p data-start=\"1366\" data-end=\"1397\">Detect performance bottlenecks.<\/p>\n<\/li>\n<li data-start=\"1398\" data-end=\"1444\">\n<p data-start=\"1400\" data-end=\"1444\">Identify memory leaks and GC pauses in JVMs.<\/p>\n<\/li>\n<li data-start=\"1445\" data-end=\"1490\">\n<p data-start=\"1447\" data-end=\"1490\">Track latency, throughput, and error rates.<\/p>\n<\/li>\n<li data-start=\"1491\" data-end=\"1538\">\n<p data-start=\"1493\" data-end=\"1538\">Visualize cluster-level resource consumption.<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"1540\" data-end=\"1666\">Prometheus and Grafana simplify this by providing reliable time-series monitoring and dashboards that scale with your cluster.<\/p>\n<hr data-start=\"1668\" data-end=\"1671\" \/>\n<h2 data-start=\"1673\" data-end=\"1691\">Core Components<\/h2>\n<h3 data-start=\"1693\" data-end=\"1710\">1. Prometheus<\/h3>\n<p data-start=\"1711\" data-end=\"1849\">Prometheus is a <strong data-start=\"1727\" data-end=\"1751\">time-series database<\/strong> built for cloud-native monitoring. It scrapes metrics from endpoints and stores them efficiently.<\/p>\n<p data-start=\"1851\" data-end=\"1868\"><strong data-start=\"1851\" data-end=\"1868\">Key Features:<\/strong><\/p>\n<ul data-start=\"1869\" data-end=\"2003\">\n<li data-start=\"1869\" data-end=\"1898\">\n<p data-start=\"1871\" data-end=\"1898\">Pull-based data collection.<\/p>\n<\/li>\n<li data-start=\"1899\" data-end=\"1932\">\n<p data-start=\"1901\" data-end=\"1932\">Flexible PromQL query language.<\/p>\n<\/li>\n<li data-start=\"1933\" data-end=\"1971\">\n<p data-start=\"1935\" data-end=\"1971\">Built-in alerting with Alertmanager.<\/p>\n<\/li>\n<li data-start=\"1972\" data-end=\"2003\">\n<p data-start=\"1974\" data-end=\"2003\">Multi-dimensional data model.<\/p>\n<\/li>\n<\/ul>\n<h3 data-start=\"2005\" data-end=\"2019\">2. Grafana<\/h3>\n<p data-start=\"2020\" data-end=\"2160\">Grafana is an <strong data-start=\"2034\" data-end=\"2086\">open-source analytics and visualization platform<\/strong> that integrates with Prometheus to present data in meaningful dashboards.<\/p>\n<p data-start=\"2162\" data-end=\"2179\"><strong data-start=\"2162\" data-end=\"2179\">Key Features:<\/strong><\/p>\n<ul data-start=\"2180\" data-end=\"2330\">\n<li data-start=\"2180\" data-end=\"2211\">\n<p data-start=\"2182\" data-end=\"2211\">Rich, interactive dashboards.<\/p>\n<\/li>\n<li data-start=\"2212\" data-end=\"2247\">\n<p data-start=\"2214\" data-end=\"2247\">Query editor with PromQL support.<\/p>\n<\/li>\n<li data-start=\"2248\" data-end=\"2287\">\n<p data-start=\"2250\" data-end=\"2287\">Alerts, annotations, and drill-downs.<\/p>\n<\/li>\n<li data-start=\"2288\" data-end=\"2330\">\n<p data-start=\"2290\" data-end=\"2330\">Multi-source and team access management.<\/p>\n<\/li>\n<\/ul>\n<h3 data-start=\"2332\" data-end=\"2349\">3. Kubernetes<\/h3>\n<p data-start=\"2350\" data-end=\"2554\">Kubernetes exposes performance data through its metrics APIs (via <strong data-start=\"2416\" data-end=\"2438\">kube-state-metrics<\/strong> and <strong data-start=\"2443\" data-end=\"2455\">cAdvisor<\/strong>). It enables Prometheus to dynamically discover and scrape metrics from Pods, Services, and Nodes.<\/p>\n<hr data-start=\"2556\" data-end=\"2559\" \/>\n<h2 data-start=\"2561\" data-end=\"2582\">Step-by-Step Setup<\/h2>\n<h3 data-start=\"2584\" data-end=\"2627\">Step 1: Deploy Prometheus on Kubernetes<\/h3>\n<p data-start=\"2628\" data-end=\"2671\">Install Prometheus via Helm for simplicity:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span>helm repo add prometheus-community https:\/\/prometheus-community.github.io\/helm-charts\nhelm repo update\nhelm install prometheus prometheus-community\/prometheus\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"2845\" data-end=\"2871\">Access Prometheus locally:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span>kubectl port-forward deploy\/prometheus-server 9090:9090\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"2941\" data-end=\"2971\">Visit: <code data-start=\"2948\" data-end=\"2971\">http:\/\/localhost:9090<\/code><\/p>\n<hr data-start=\"2973\" data-end=\"2976\" \/>\n<h3 data-start=\"2978\" data-end=\"3021\">Step 2: Expose Java Application Metrics<\/h3>\n<p data-start=\"3022\" data-end=\"3109\">Expose metrics in your Java app using <strong data-start=\"3060\" data-end=\"3074\">Micrometer<\/strong> (built into Spring Boot Actuator).<\/p>\n<p data-start=\"3111\" data-end=\"3130\"><strong data-start=\"3111\" data-end=\"3130\">Add dependency:<\/strong><\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-xml\"><span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency<\/span><\/span>&gt;\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId<\/span><\/span>&gt;io.micrometer<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">groupId<\/span><\/span>&gt;\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId<\/span><\/span>&gt;micrometer-registry-prometheus<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">artifactId<\/span><\/span>&gt;\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">dependency<\/span><\/span>&gt;\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"3263\" data-end=\"3294\"><strong data-start=\"3263\" data-end=\"3294\">Enable Prometheus endpoint:<\/strong><\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-yaml\"><span><span class=\"hljs-attr\">management:<\/span>\n  <span class=\"hljs-attr\">endpoints:<\/span>\n    <span class=\"hljs-attr\">web:<\/span>\n      <span class=\"hljs-attr\">exposure:<\/span>\n        <span class=\"hljs-attr\">include:<\/span> <span class=\"hljs-string\">prometheus<\/span>\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"3386\" data-end=\"3424\">Your metrics will now be available at:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span>\/actuator\/prometheus\n<\/span><\/code><\/div>\n<\/div>\n<hr data-start=\"3455\" data-end=\"3458\" \/>\n<h3 data-start=\"3460\" data-end=\"3501\">Step 3: Configure Prometheus Scraping<\/h3>\n<p data-start=\"3502\" data-end=\"3564\">Edit the Prometheus configuration to scrape your Java service:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-yaml\"><span><span class=\"hljs-attr\">scrape_configs:<\/span>\n  <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-attr\">job_name:<\/span> <span class=\"hljs-string\">'java-app'<\/span>\n    <span class=\"hljs-attr\">metrics_path:<\/span> <span class=\"hljs-string\">'\/actuator\/prometheus'<\/span>\n    <span class=\"hljs-attr\">static_configs:<\/span>\n      <span class=\"hljs-bullet\">-<\/span> <span class=\"hljs-attr\">targets:<\/span> [<span class=\"hljs-string\">'java-app-service.default.svc.cluster.local:8080'<\/span>]\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"3750\" data-end=\"3855\">Reload the Prometheus configuration, and it will start scraping your application\u2019s metrics automatically.<\/p>\n<hr data-start=\"3857\" data-end=\"3860\" \/>\n<h3 data-start=\"3862\" data-end=\"3914\">Step 4: Deploy Grafana and Connect to Prometheus<\/h3>\n<p data-start=\"3915\" data-end=\"3942\">Install Grafana using Helm:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span>helm install grafana grafana\/grafana\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"3994\" data-end=\"4013\">Expose the service:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-bash\"><span>kubectl port-forward svc\/grafana 3000:3000\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"4070\" data-end=\"4090\">Default credentials:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span>Username: <span class=\"hljs-keyword\">admin<\/span>\n<span class=\"hljs-keyword\">Password<\/span>: <span class=\"hljs-keyword\">admin<\/span>\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"4132\" data-end=\"4196\">In Grafana \u2192 <em data-start=\"4145\" data-end=\"4170\">Settings \u2192 Data Sources<\/em>, add Prometheus with URL:<\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span>http:<span class=\"hljs-comment\">\/\/prometheus-server:9090<\/span>\n<\/span><\/code><\/div>\n<\/div>\n<hr data-start=\"4236\" data-end=\"4239\" \/>\n<h3 data-start=\"4241\" data-end=\"4277\">Step 5: Build Grafana Dashboards<\/h3>\n<p data-start=\"4278\" data-end=\"4405\">Import pre-made dashboards from the <a data-start=\"4314\" data-end=\"4382\" class=\"decorated-link cursor-pointer\" rel=\"noopener\" target=\"_new\">Grafana Dashboard Library<span aria-hidden=\"true\" class=\"ms-0.5 inline-block align-middle leading-none\"><svg width=\"20\" height=\"20\" viewbox=\"0 0 20 20\" fill=\"currentColor\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" data-rtl-flip=\"\" class=\"block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]\"><path d=\"M14.3349 13.3301V6.60645L5.47065 15.4707C5.21095 15.7304 4.78895 15.7304 4.52925 15.4707C4.26955 15.211 4.26955 14.789 4.52925 14.5293L13.3935 5.66504H6.66011C6.29284 5.66504 5.99507 5.36727 5.99507 5C5.99507 4.63273 6.29284 4.33496 6.66011 4.33496H14.9999L15.1337 4.34863C15.4369 4.41057 15.665 4.67857 15.665 5V13.3301C15.6649 13.6973 15.3672 13.9951 14.9999 13.9951C14.6327 13.9951 14.335 13.6973 14.3349 13.3301Z\"><\/path><\/svg><\/span><\/a> or create custom ones.<\/p>\n<p data-start=\"4407\" data-end=\"4430\"><strong data-start=\"4407\" data-end=\"4430\">Common <a href=\"https:\/\/harshad-sonawane.com\/blog\/java-memory-management-heap-gc-best\/\">JVM<\/a> metrics:<\/strong><\/p>\n<div class=\"_tableContainer_1rjym_1\">\n<div class=\"group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse\" tabindex=\"-1\">\n<table data-start=\"4431\" data-end=\"4709\" class=\"w-fit min-w-(--thread-content-width)\">\n<thead data-start=\"4431\" data-end=\"4455\">\n<tr data-start=\"4431\" data-end=\"4455\">\n<th data-start=\"4431\" data-end=\"4440\" data-col-size=\"sm\">Metric<\/th>\n<th data-start=\"4440\" data-end=\"4455\" data-col-size=\"sm\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"4482\" data-end=\"4709\">\n<tr data-start=\"4482\" data-end=\"4542\">\n<td data-start=\"4482\" data-end=\"4508\" data-col-size=\"sm\"><code data-start=\"4484\" data-end=\"4507\">jvm_memory_used_bytes<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"4508\" data-end=\"4542\">JVM heap\/non-heap memory usage<\/td>\n<\/tr>\n<tr data-start=\"4543\" data-end=\"4588\">\n<td data-start=\"4543\" data-end=\"4568\" data-col-size=\"sm\"><code data-start=\"4545\" data-end=\"4567\">jvm_gc_pause_seconds<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"4568\" data-end=\"4588\">Time spent in GC<\/td>\n<\/tr>\n<tr data-start=\"4589\" data-end=\"4641\">\n<td data-start=\"4589\" data-end=\"4622\" data-col-size=\"sm\"><code data-start=\"4591\" data-end=\"4621\">http_server_requests_seconds<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"4622\" data-end=\"4641\">Request latency<\/td>\n<\/tr>\n<tr data-start=\"4642\" data-end=\"4709\">\n<td data-start=\"4642\" data-end=\"4680\" data-col-size=\"sm\"><code data-start=\"4644\" data-end=\"4679\">container_cpu_usage_seconds_total<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"4680\" data-end=\"4709\">Pod-level CPU consumption<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p data-start=\"4711\" data-end=\"4736\"><strong data-start=\"4711\" data-end=\"4736\">Example PromQL query:<\/strong><\/p>\n<div class=\"contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-promql\"><span>rate(http_server_requests_seconds_count{status!~\"2..\"}[5m])\n<\/span><\/code><\/div>\n<\/div>\n<p data-start=\"4811\" data-end=\"4865\">Displays non-2xx HTTP requests over a 5-minute window.<\/p>\n<hr data-start=\"4867\" data-end=\"4870\" \/>\n<h2 data-start=\"4872\" data-end=\"4889\">Best Practices<\/h2>\n<ol data-start=\"4890\" data-end=\"5430\">\n<li data-start=\"4890\" data-end=\"4998\">\n<p data-start=\"4893\" data-end=\"4998\"><strong data-start=\"4893\" data-end=\"4923\">Use Labels and Annotations<\/strong> \u2014 Tag services with labels (<code data-start=\"4952\" data-end=\"4957\">app<\/code>, <code data-start=\"4959\" data-end=\"4968\">version<\/code>, <code data-start=\"4970\" data-end=\"4975\">env<\/code>) for easy filtering.<\/p>\n<\/li>\n<li data-start=\"4999\" data-end=\"5097\">\n<p data-start=\"5002\" data-end=\"5097\"><strong data-start=\"5002\" data-end=\"5024\">Set Alerting Rules<\/strong> \u2014 Use Prometheus Alertmanager to notify when thresholds exceed limits.<\/p>\n<\/li>\n<li data-start=\"5098\" data-end=\"5208\">\n<p data-start=\"5101\" data-end=\"5208\"><strong data-start=\"5101\" data-end=\"5121\">Secure Endpoints<\/strong> \u2014 Protect <code data-start=\"5132\" data-end=\"5154\">\/actuator\/prometheus<\/code> with authentication or Kubernetes network policies.<\/p>\n<\/li>\n<li data-start=\"5209\" data-end=\"5310\">\n<p data-start=\"5212\" data-end=\"5310\"><strong data-start=\"5212\" data-end=\"5233\">Service Discovery<\/strong> \u2014 Let Prometheus automatically detect new Pods via Kubernetes annotations.<\/p>\n<\/li>\n<li data-start=\"5311\" data-end=\"5430\">\n<p data-start=\"5314\" data-end=\"5430\"><strong data-start=\"5314\" data-end=\"5340\">Dashboard Organization<\/strong> \u2014 Separate cluster-wide metrics, JVM metrics, and business KPIs into distinct dashboards.<\/p>\n<\/li>\n<\/ol>\n<hr data-start=\"5432\" data-end=\"5435\" \/>\n<h2 data-start=\"5437\" data-end=\"5455\">Troubleshooting<\/h2>\n<div class=\"_tableContainer_1rjym_1\">\n<div class=\"group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse\" tabindex=\"-1\">\n<table data-start=\"5456\" data-end=\"5797\" class=\"w-fit min-w-(--thread-content-width)\">\n<thead data-start=\"5456\" data-end=\"5480\">\n<tr data-start=\"5456\" data-end=\"5480\">\n<th data-start=\"5456\" data-end=\"5464\" data-col-size=\"sm\">Issue<\/th>\n<th data-start=\"5464\" data-end=\"5480\" data-col-size=\"md\">Possible Fix<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"5508\" data-end=\"5797\">\n<tr data-start=\"5508\" data-end=\"5581\">\n<td data-start=\"5508\" data-end=\"5539\" data-col-size=\"sm\">Prometheus not scraping data<\/td>\n<td data-start=\"5539\" data-end=\"5581\" data-col-size=\"md\">Check <code data-start=\"5547\" data-end=\"5561\">kubectl logs<\/code> for target errors<\/td>\n<\/tr>\n<tr data-start=\"5582\" data-end=\"5650\">\n<td data-start=\"5582\" data-end=\"5611\" data-col-size=\"sm\">Metrics missing in Grafana<\/td>\n<td data-start=\"5611\" data-end=\"5650\" data-col-size=\"md\">Verify time range and PromQL syntax<\/td>\n<\/tr>\n<tr data-start=\"5651\" data-end=\"5725\">\n<td data-start=\"5651\" data-end=\"5669\" data-col-size=\"sm\">No Java metrics<\/td>\n<td data-start=\"5669\" data-end=\"5725\" data-col-size=\"md\">Confirm <code data-start=\"5679\" data-end=\"5701\">\/actuator\/prometheus<\/code> endpoint is reachable<\/td>\n<\/tr>\n<tr data-start=\"5726\" data-end=\"5797\">\n<td data-start=\"5726\" data-end=\"5750\" data-col-size=\"sm\">Authentication errors<\/td>\n<td data-start=\"5750\" data-end=\"5797\" data-col-size=\"md\">Update <code data-start=\"5759\" data-end=\"5775\">ServiceAccount<\/code> or RBAC permissions<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<hr data-start=\"5799\" data-end=\"5802\" \/>\n<h2 data-start=\"5804\" data-end=\"5817\">Conclusion<\/h2>\n<p data-start=\"5818\" data-end=\"6117\">By combining <strong data-start=\"5831\" data-end=\"5845\">Prometheus<\/strong> and <strong data-start=\"5850\" data-end=\"5861\">Grafana<\/strong>, Java developers can achieve end-to-end visibility into their <a href=\"https:\/\/harshad-sonawane.com\/blog\/build-high-performance-java-apis-using-grpc\/\">microservices<\/a> running on Kubernetes.<br data-start=\"5960\" data-end=\"5963\" \/>This setup ensures you can monitor JVM health, request latencies, and resource utilization in real time \u2014 enabling proactive optimization and reliability.<\/p>\n<p data-start=\"6119\" data-end=\"6237\">When implemented properly, this monitoring stack forms the backbone of an effective <strong data-start=\"6203\" data-end=\"6236\">DevOps observability strategy<\/strong>.<\/p>\n<h2 data-start=\"6244\" data-end=\"6257\">References<\/h2>\n<ul data-start=\"6258\" data-end=\"6557\">\n<li data-start=\"6258\" data-end=\"6339\">\n<p data-start=\"6260\" data-end=\"6339\"><a data-start=\"6260\" data-end=\"6337\" rel=\"noopener\" target=\"_new\" class=\"decorated-link cursor-pointer\">Prometheus Documentation<span aria-hidden=\"true\" class=\"ms-0.5 inline-block align-middle leading-none\"><svg width=\"20\" height=\"20\" viewbox=\"0 0 20 20\" fill=\"currentColor\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" data-rtl-flip=\"\" class=\"block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]\"><path d=\"M14.3349 13.3301V6.60645L5.47065 15.4707C5.21095 15.7304 4.78895 15.7304 4.52925 15.4707C4.26955 15.211 4.26955 14.789 4.52925 14.5293L13.3935 5.66504H6.66011C6.29284 5.66504 5.99507 5.36727 5.99507 5C5.99507 4.63273 6.29284 4.33496 6.66011 4.33496H14.9999L15.1337 4.34863C15.4369 4.41057 15.665 4.67857 15.665 5V13.3301C15.6649 13.6973 15.3672 13.9951 14.9999 13.9951C14.6327 13.9951 14.335 13.6973 14.3349 13.3301Z\"><\/path><\/svg><\/span><\/a><\/p>\n<\/li>\n<li data-start=\"6340\" data-end=\"6394\">\n<p data-start=\"6342\" data-end=\"6394\"><a data-start=\"6342\" data-end=\"6392\" rel=\"noopener\" target=\"_new\" class=\"decorated-link cursor-pointer\">Grafana Documentation<span aria-hidden=\"true\" class=\"ms-0.5 inline-block align-middle leading-none\"><svg width=\"20\" height=\"20\" viewbox=\"0 0 20 20\" fill=\"currentColor\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" data-rtl-flip=\"\" class=\"block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]\"><path d=\"M14.3349 13.3301V6.60645L5.47065 15.4707C5.21095 15.7304 4.78895 15.7304 4.52925 15.4707C4.26955 15.211 4.26955 14.789 4.52925 14.5293L13.3935 5.66504H6.66011C6.29284 5.66504 5.99507 5.36727 5.99507 5C5.99507 4.63273 6.29284 4.33496 6.66011 4.33496H14.9999L15.1337 4.34863C15.4369 4.41057 15.665 4.67857 15.665 5V13.3301C15.6649 13.6973 15.3672 13.9951 14.9999 13.9951C14.6327 13.9951 14.335 13.6973 14.3349 13.3301Z\"><\/path><\/svg><\/span><\/a><\/p>\n<\/li>\n<li data-start=\"6395\" data-end=\"6448\">\n<p data-start=\"6397\" data-end=\"6448\"><a data-start=\"6397\" data-end=\"6446\" rel=\"noopener\" target=\"_new\" class=\"decorated-link cursor-pointer\">Micrometer Project<span aria-hidden=\"true\" class=\"ms-0.5 inline-block align-middle leading-none\"><svg width=\"20\" height=\"20\" viewbox=\"0 0 20 20\" fill=\"currentColor\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" data-rtl-flip=\"\" class=\"block h-[0.75em] w-[0.75em] stroke-current stroke-[0.75]\"><path d=\"M14.3349 13.3301V6.60645L5.47065 15.4707C5.21095 15.7304 4.78895 15.7304 4.52925 15.4707C4.26955 15.211 4.26955 14.789 4.52925 14.5293L13.3935 5.66504H6.66011C6.29284 5.66504 5.99507 5.36727 5.99507 5C5.99507 4.63273 6.29284 4.33496 6.66011 4.33496H14.9999L15.1337 4.34863C15.4369 4.41057 15.665 4.67857 15.665 5V13.3301C15.6649 13.6973 15.3672 13.9951 14.9999 13.9951C14.6327 13.9951 14.335 13.6973 14.3349 13.3301Z\"><\/path><\/svg><\/span><\/a><\/p>\n<\/li>\n<li data-start=\"6449\" data-end=\"6557\">\n<p data-start=\"6451\" data-end=\"6557\"><a data-start=\"6451\" data-end=\"6557\" rel=\"noopener\" target=\"_new\" class=\"decorated-link cursor-pointer\">Spring Boot Actuator Guide<\/a><\/p>\n<\/li>\n<\/ul>\n<p><\/p>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\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>Introduction Modern microservices-based architectures rely heavily on observability to ensure applications perform reliably at scale.For Java applications running on Kubernetes, Prometheus and Grafana are the standard tools for monitoring and visualization. Together, they offer a flexible system for collecting, storing, and analyzing metrics \u2014 allowing developers to detect issues before [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":307,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":"","jetpack_publicize_message":"Just published: \u201cMonitoring Java Applications with Prometheus and Grafana on Kubernetes\u201d \u2014 a complete practical guide to setting up real-time observability for Java microservices.\nLearn how to configure Prometheus, visualize data in Grafana, and set up alerts for performance insights.\nRead here: https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\n\n#Prometheus #Grafana #Kubernetes #Java #Monitoring #DevOps","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":[8,260,2,7,259,261,258],"class_list":["post-305","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-spring-boot-aws-microservices","tag-devops","tag-grafana","tag-java","tag-kubernetes","tag-monitoring","tag-observability","tag-prometheus"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Monitoring Java Applications with Prometheus and Grafana on Kubernetes - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;<\/title>\n<meta name=\"description\" content=\"Learn how to monitor Java applications deployed on Kubernetes using Prometheus and Grafana. A hands-on guide with setup steps, metrics, dashboards, and best practices.\" \/>\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\/monitoring-java-applications-prometheus-grafana-kubernetes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitoring Java Applications with Prometheus and Grafana on Kubernetes - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;\" \/>\n<meta property=\"og:description\" content=\"Learn how to monitor Java applications deployed on Kubernetes using Prometheus and Grafana. A hands-on guide with setup steps, metrics, dashboards, and best practices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/\" \/>\n<meta property=\"og:site_name\" content=\"&lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-15T05:55:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\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=\"3 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\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/\"},\"author\":{\"name\":\"HS\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"headline\":\"Monitoring Java Applications with Prometheus and Grafana on Kubernetes\",\"datePublished\":\"2025-11-15T05:55:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/\"},\"wordCount\":566,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#\\\/schema\\\/person\\\/d82781218ba30c34fa81b49e8393681e\"},\"image\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png\",\"keywords\":[\"DevOps\",\"Grafana\",\"Java\",\"Kubernetes\",\"Monitoring\",\"Observability\",\"Prometheus\"],\"articleSection\":[\"Java, Spring Boot, AWS, Microservices\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/\",\"name\":\"Monitoring Java Applications with Prometheus and Grafana on Kubernetes - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\\\/&gt;\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png\",\"datePublished\":\"2025-11-15T05:55:00+00:00\",\"description\":\"Learn how to monitor Java applications deployed on Kubernetes using Prometheus and Grafana. A hands-on guide with setup steps, metrics, dashboards, and best practices.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#primaryimage\",\"url\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png\",\"contentUrl\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png\",\"width\":1024,\"height\":1024,\"caption\":\"Infrastructure as Code with Terraform: A Practical Guide for Java Developers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/monitoring-java-applications-prometheus-grafana-kubernetes\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/harshad-sonawane.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Monitoring Java Applications with Prometheus and Grafana on Kubernetes\"}]},{\"@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":"Monitoring Java Applications with Prometheus and Grafana on Kubernetes - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","description":"Learn how to monitor Java applications deployed on Kubernetes using Prometheus and Grafana. A hands-on guide with setup steps, metrics, dashboards, and best practices.","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\/monitoring-java-applications-prometheus-grafana-kubernetes\/","og_locale":"en_US","og_type":"article","og_title":"Monitoring Java Applications with Prometheus and Grafana on Kubernetes - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","og_description":"Learn how to monitor Java applications deployed on Kubernetes using Prometheus and Grafana. A hands-on guide with setup steps, metrics, dashboards, and best practices.","og_url":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/","og_site_name":"&lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","article_published_time":"2025-11-15T05:55:00+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png","type":"image\/png"}],"author":"HS","twitter_card":"summary_large_image","twitter_misc":{"Written by":"HS","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#article","isPartOf":{"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/"},"author":{"name":"HS","@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"headline":"Monitoring Java Applications with Prometheus and Grafana on Kubernetes","datePublished":"2025-11-15T05:55:00+00:00","mainEntityOfPage":{"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/"},"wordCount":566,"commentCount":0,"publisher":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#\/schema\/person\/d82781218ba30c34fa81b49e8393681e"},"image":{"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#primaryimage"},"thumbnailUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png","keywords":["DevOps","Grafana","Java","Kubernetes","Monitoring","Observability","Prometheus"],"articleSection":["Java, Spring Boot, AWS, Microservices"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/","url":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/","name":"Monitoring Java Applications with Prometheus and Grafana on Kubernetes - &lt;&gt;HARSHAD&#039;s Dev Diary&lt;\/&gt;","isPartOf":{"@id":"https:\/\/harshad-sonawane.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#primaryimage"},"image":{"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#primaryimage"},"thumbnailUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png","datePublished":"2025-11-15T05:55:00+00:00","description":"Learn how to monitor Java applications deployed on Kubernetes using Prometheus and Grafana. A hands-on guide with setup steps, metrics, dashboards, and best practices.","breadcrumb":{"@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#primaryimage","url":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png","contentUrl":"https:\/\/harshad-sonawane.com\/blog\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-Oct-25-2025-10_43_37-PM.png","width":1024,"height":1024,"caption":"Infrastructure as Code with Terraform: A Practical Guide for Java Developers"},{"@type":"BreadcrumbList","@id":"https:\/\/harshad-sonawane.com\/blog\/monitoring-java-applications-prometheus-grafana-kubernetes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/harshad-sonawane.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Monitoring Java Applications with Prometheus and Grafana on Kubernetes"}]},{"@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\/305","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=305"}],"version-history":[{"count":2,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"predecessor-version":[{"id":308,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions\/308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/media\/307"}],"wp:attachment":[{"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harshad-sonawane.com\/blog\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}