Skip to content

Monitor Java/JMX applications running on Amazon EKS

v3.0.0 breaking change

The enable_java and java_config variables have been removed in v3.0.0. Java/JMX scrape targets are now added via additional_scrape_jobs. See the Upgrading to v3.0.0 guide.

Setup with v3.0.0

Add your Java/JMX metrics endpoint as an additional scrape job:

module "eks_monitoring" {
  source = "github.com/aws-observability/terraform-aws-observability-accelerator//modules/eks-monitoring?ref=v3.0.0"

  providers = { grafana = grafana }

  collector_profile     = "self-managed-amp"  # or "cloudwatch-otlp"
  eks_cluster_id        = var.eks_cluster_id

  additional_scrape_jobs = [
    {
      job_name        = "java-jmx"
      scrape_interval = "30s"
      static_configs = [
        { targets = ["my-java-app.default.svc.cluster.local:9404"] }
      ]
    }
  ]
}

For the managed-metrics profile, the same scrape job format applies — it is passed to the AMP Managed Collector's scrape configuration.

Custom dashboards

To add a Java/JMX Grafana dashboard, include it in dashboard_sources:

module "eks_monitoring" {
  # ...
  dashboard_sources = {
    java-jmx = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.3.2/artifacts/grafana-dashboards/eks/java/default.json"
  }
}

Deploy a sample Java application

See the AWS OTel Collector JMX documentation for a complete walkthrough of deploying a sample Tomcat application with JMX metrics on EKS.

Resources