Live:CloudOps Webinars & Hands-on Workshops ·Register ↗
Skip to main content

EKS Java Application Monitoring

Overview​

Instrument Java/JVM applications running on Amazon EKS with CloudWatch Application Signals for automatic service map generation, latency tracking, and error rate monitoring — with zero code changes.

Application Signals uses the OpenTelemetry Java agent auto-instrumentation to capture:

  • HTTP request/response metrics (latency, error rate, throughput)
  • Downstream dependency calls (databases, other services, AWS SDKs)
  • Distributed traces correlated with metrics
  • JVM runtime metrics (heap, GC, threads)

Prerequisites​

  • Amazon EKS cluster (v1.27+)
  • Java application deployed as a Kubernetes Deployment
  • CloudWatch agent with Application Signals enabled
  • ADOT add-on or OpenTelemetry Operator installed
  • IAM permissions for CloudWatch and X-Ray

Architecture​

┌─────────────────────────────────────────────────────┐
│ EKS Cluster │
│ ┌───────────────────────────────────────────────┐ │
│ │ Application Pod │ │
│ │ ┌─────────────┐ ┌────────────────────┐ │ │
│ │ │ Java App │ │ OTel Java Agent │ │ │
│ │ │ │◄───│ (auto-instrument) │ │ │
│ │ └─────────────┘ └─────────┬──────────┘ │ │
│ └───────────────────────────────┼───────────────┘ │
│ │ │
│ ┌───────────────────────────────▼───────────────┐ │
│ │ CloudWatch Agent (DaemonSet) │ │
│ └───────────────────────────────┬───────────────┘ │
└──────────────────────────────────┼───────────────────┘
│
┌──────────────┼──────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────┐ ┌────────────┐
│ CloudWatch │ │ X-Ray │ │ Application│
│ Metrics │ │ Traces │ │ Signals │
└──────────────┘ └──────────┘ └────────────┘

Deploy​

Step 1: Enable the ADOT add-on​

aws eks create-addon \
--cluster-name my-cluster \
--addon-name adot \
--addon-version v0.92.1-eksbuild.1

Step 2: Annotate your application namespace​

apiVersion: v1
kind: Namespace
metadata:
name: my-app
labels:
aws-observability: enabled

Step 3: Add instrumentation annotation to your Deployment​

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-java-app
spec:
template:
metadata:
annotations:
instrumentation.opentelemetry.io/inject-java: "true"
spec:
containers:
- name: app
image: my-java-app:latest

Step 4: Deploy CloudWatch agent​

aws eks create-addon \
--cluster-name my-cluster \
--addon-name amazon-cloudwatch-observability

Validate​

  1. Check auto-instrumentation is injected:

    kubectl get pods -n my-app -o jsonpath='{.items[*].spec.initContainers[*].name}'
    # Should show: opentelemetry-auto-instrumentation
  2. Generate traffic and check Application Signals: Navigate to CloudWatch > Application Signals > Services.

  3. Verify traces in X-Ray: Navigate to CloudWatch > X-Ray traces > Trace map.

Troubleshoot​

SymptomLikely CauseFix
No init container injectedInstrumentation CR missingVerify kubectl get instrumentation -A
App crashes after instrumentationAgent compatibilityCheck Java version >= 8, try pinning agent version
Traces but no Application SignalsCloudWatch agent not forwardingCheck CW agent config and IAM role
High latency after instrumentationSampling too aggressiveAdjust sampling rate in collector config