Skip to content

update: Migrate Container Insights to the CloudWatch Observability add-on (OTel, drop ADOT) - #1904

Open
JaviGG02 wants to merge 2 commits into
aws-samples:mainfrom
JaviGG02:container-insights-cloudwatch-addon
Open

update: Migrate Container Insights to the CloudWatch Observability add-on (OTel, drop ADOT)#1904
JaviGG02 wants to merge 2 commits into
aws-samples:mainfrom
JaviGG02:container-insights-cloudwatch-addon

Conversation

@JaviGG02

@JaviGG02 JaviGG02 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Migrates the Container Insights on EKS lab to the current recommended setup (part of #1895, item
3): from manually-deployed ADOT collectors to the Amazon CloudWatch Observability EKS add-on with
OTel Container Insights, following the [AWS
quickstart](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/container-insights-eks-otel-
quickstart.html). ADOT is no longer referenced in the chapter — the content explains that the
CloudWatch agent uses OpenTelemetry under the hood. This PR updates both the content and the lab
preparation (Terraform/cleanup/tests) so the module is consistent and passes automated testing.

Content

  • Cluster metrics (collect-metrics-adot-ci.md): replaced the hand-deployed ADOT DaemonSet
    collector with the amazon-cloudwatch-observability add-on, granting the CloudWatch agent permissions
    via EKS Pod Identity — create an IAM role (trust pods.eks.amazonaws.com) with
    CloudWatchAgentServerPolicy, associate it with the cloudwatch-agent service account, then enable
    the add-on with otelContainerInsights. The EKS Pod Identity Agent is preinstalled by
    prepare-environment. Verification checks the cloudwatch-agent pods in the amazon-cloudwatch
    namespace.
  • Application metrics (visualize-application-metrics-cloudwatch.md): replaced the second
    (Prometheus) ADOT collector with the CloudWatch agent's Prometheus scraping, configured through the
    add-on's agent.otelConfig (Prometheus receiver → awsemf exporter to the
    ContainerInsights/Prometheus namespace). The scrape runs on the add-on's single-replica cluster
    scraper, so no separate collector or IAM role is needed. Fixed the dashboard name to
    Order-Service-Metrics-1 to match the resource that is actually created.
  • Log Analytics (logs-insights.md): added a tip to select the
    /aws/containerinsights/eks-workshop/performance log group before running a query, and replaced the
    container-restarts example query (no data when no restarts occurred) with a pod_memory_utilization
    query that always has data.
  • index.md: updated the "Before you start" summary to match the new flow.
  • Refreshed the affected screenshots (Container Insights console, Log Analytics query results).

Lab preparation (Terraform / cleanup / tests)

  • Terraform: prepare-environment now installs the eks-pod-identity-agent add-on
    (aws_eks_addon, resolve_conflicts_on_create=OVERWRITE) and keeps the Order-Service-Metrics-1
    dashboard; the OpenTelemetry operator, cert-manager and the ADOT IRSA role are removed.
  • cleanup.sh: deletes the observability add-on, the Pod Identity association and the
    cloudwatch-agent IAM role so the module is re-runnable; dropped the opentelemetrycollectors
    cleanup.
  • tests: hook-install.sh waits for the eks-pod-identity-agent pods; removed the obsolete
    hook-deploy-adot-ci.sh.
  • The application-metrics add-on config lives in a repo file
    (cwagent-prometheus/cloudwatch-agent-prometheus.yaml) referenced via ::yaml, rather than an in-lab
    heredoc.

Note: the old adot/ and adot-deployment/ manifests are intentionally kept in this PR because the
auto-generated ja translations still reference them (removing them would fail the website build).
They will be removed in a follow-up once the translation pipeline regenerates ja from the updated
English content.

Which issue(s) this PR fixes:

Part of #1895

Quality checks

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this
contribution, under the terms of your choice.

…grate to CloudWatch Observability add-on (OTel), drop ADOT + refresh queries/screenshots

Migrate the Container Insights on EKS lab from manually-deployed ADOT collectors
to the Amazon CloudWatch Observability EKS add-on (OTel Container Insights):
- Cluster metrics: enable the add-on via EKS Pod Identity (pod-identity-agent,
  IAM role with CloudWatchAgentServerPolicy, association, otelContainerInsights).
- Application metrics: scrape Prometheus via the add-on's agent.otelConfig
  (prometheus receiver -> awsemf) instead of a dedicated ADOT collector; fix
  dashboard name to Order-Service-Metrics-1.
- Log Analytics: add log-group selection tip and swap the container-restarts
  query for pod_memory_utilization.
- Refresh screenshots.

Signed-off-by: Javier Garcia <jxgarci@amazon.com>
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for eks-workshop ready!

Name Link
🔨 Latest commit f88e9e1
🔍 Latest deploy log https://app.netlify.com/projects/eks-workshop/deploys/6a7b33c10f8f290009e21b35
😎 Deploy Preview https://deploy-preview-1904--eks-workshop.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…ith the add-on migration

- Terraform: preinstall the eks-pod-identity-agent add-on (aws_eks_addon,
  resolve_conflicts_on_create=OVERWRITE) and keep the Order-Service-Metrics-1
  dashboard; remove the OpenTelemetry operator, cert-manager and the ADOT IRSA role.
- collect-metrics: note prepare-environment preinstalled the Pod Identity Agent;
  inline the IAM trust policy (no heredoc, works in the test harness).
- Application metrics: move the add-on Prometheus config to a repo file referenced
  via ::yaml instead of an in-lab heredoc.
- cleanup.sh: delete the observability add-on, Pod Identity association and the
  cloudwatch-agent IAM role; drop the opentelemetrycollectors cleanup.
- tests: hook-install waits for eks-pod-identity-agent pods; remove hook-deploy-adot-ci.sh.

Validated: make test module="observability/container-insights" -> 3 passing.
Signed-off-by: Javier Garcia <jxgarci@amazon.com>
@JaviGG02

Copy link
Copy Markdown
Contributor Author

Just as a reference, make test output:

==> make test module="observability/container-insights"
bash hack/run-tests.sh '' observability/container-insights '-'
Building container images...
sha256:5f77170...835ca
sha256:743d55...3830
Using current user credentials
Resolved source IP address: xxxxx
Inbound CIDRs: xxxxxx
Running test suite...
Added new context arn:aws:eks:us-west-2:xxxx:cluster/eks-workshop-auto to /home/ec2-user/.kube/config
Added new context arn:aws:eks:us-west-2:xxxx:cluster/eks-workshop to /home/ec2-user/.kube/config

EKS Workshop
Observability
Container Insights on EKS
✔ Container Insights on EKS (186079ms)
✔ Cluster metrics (359750ms)
✔ Application Metrics (27834ms)

3 passing (12m)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant