SkillSprout
Chapter 8 · Lesson 1
Intermediate
6 min read

Amazon Managed Service for Prometheus and Managed Grafana

Overview

Prometheus is the open-source standard for collecting time-series metrics from containers and Kubernetes, and Grafana is the popular dashboard tool that reads from it. Running both yourself means managing storage, scaling, upgrades and high availability. Amazon Managed Service for Prometheus (AMP) and Amazon Managed Grafana (AMG) give you the same open-source experience as fully managed services, so the operator concentrates on what to measure rather than on servers.

An analogy: Prometheus is a fleet of reporters who scrape numbers from every machine each 30 seconds and file them in a giant ledger; AMP is a managed archive that never runs out of shelf space; Grafana is the wall of screens in the operations centre that shows the ledger as graphs and alerts.

SOA-C03 lists both services as in scope and expects you to configure monitoring and logging for workloads such as containers, using AWS services other than CloudWatch alone.

Key Concepts

  • AMP workspace is the logical Prometheus-compatible store; it exposes a remote write endpoint, a PromQL query endpoint, rules and an alert manager. Access is signed with SigV4.
  • Collectors send metrics to AMP: an AWS managed collector (agentless scraper for EKS), the AWS Distro for OpenTelemetry (ADOT) collector, or a self-run Prometheus server with remote write.
  • PromQL queries metrics such as rate(http_requests_total[5m]); recording and alerting rules are stored in the workspace.
  • Alert manager in AMP routes alerts to Amazon SNS topics, from which email, chat or incident tools can be notified.
  • Amazon Managed Grafana workspaces are authenticated with IAM Identity Center or SAML; roles are Admin, Editor, Viewer.
  • Data sources for AMG include AMP, CloudWatch, X-Ray, Athena, OpenSearch, Timestream and more; one dashboard can combine them.
  • AMP is highly available across multiple AZs, scales automatically, and retention defaults to 150 days (configurable).
  • Choose CloudWatch Container Insights for quick, AWS-native container metrics and AMP + AMG when teams already use Prometheus exporters, PromQL or Grafana dashboards.

Detailed Notes

When to pick which service

RequirementBest fit
Native AWS metrics, alarms and automatic actionsCloudWatch
Prometheus exporters, PromQL, Kubernetes ecosystem metrics at high cardinalityAMP
Single pane of glass across CloudWatch, AMP, X-Ray, SQL and third-party dataAmazon Managed Grafana
Quick container dashboards with no setup beyond an add-onContainer Insights
Distributed tracesX-Ray / OpenTelemetry (next lesson)

Setting up AMP

bash
aws amp create-workspace --alias prod-eks
aws amp list-workspaces
# Remote write URL pattern
# https://aps-workspaces.us-east-1.amazonaws.com/workspaces/ws-1234abcd/api/v1/remote_write

Ways to ingest metrics from an EKS cluster:

MethodNotes
AWS managed collectorAgentless scraper created per cluster; AWS runs it, you supply a scrape configuration and networking (subnets, security groups)
ADOT collectorDeployed as an EKS add-on or Helm chart; can also forward traces and logs; needs an IAM role (IRSA / Pod Identity) with aps:RemoteWrite
Self-managed PrometheusAdd a remote_write block with sigv4 authentication
yaml
remote_write:
  - url: https://aps-workspaces.us-east-1.amazonaws.com/workspaces/ws-1234abcd/api/v1/remote_write
    sigv4:
      region: us-east-1
    queue_config:
      max_samples_per_send: 1000

IAM permissions: aps:RemoteWrite for ingestion, aps:QueryMetrics, aps:GetSeries, aps:GetLabels, aps:GetMetricMetadata for queries, and the managed policies AmazonPrometheusRemoteWriteAccess and AmazonPrometheusQueryAccess.

Alerting

Alerting rules are YAML evaluated by the workspace; the alert manager definition routes to SNS.

yaml
groups:
  - name: web
    rules:
      - alert: HighErrorRate
        expr: sum(rate(http_requests_total{code=~"5.."}[5m])) / sum(rate(http_requests_total[5m])) > 0.05
        for: 10m
        labels: { severity: page }
        annotations: { summary: "5xx ratio above 5% for 10 minutes" }
yaml
alertmanager_config: |
  route:
    receiver: sns
  receivers:
    - name: sns
      sns_configs:
        - topic_arn: arn:aws:sns:us-east-1:111122223333:ops-alerts
          sigv4: { region: us-east-1 }

The SNS topic access policy must allow the AMP service principal (aps.amazonaws.com) to publish.

Amazon Managed Grafana

StepDetail
Create workspacePick authentication (IAM Identity Center recommended or SAML) and permission type: service managed (AWS creates roles for data sources) or customer managed
Add data sourcesAMP, CloudWatch, X-Ray, etc.; with service-managed permissions the role gets read access automatically
Build dashboardsImport community dashboards for Kubernetes, node exporter, and so on
ShareAssign users or groups as Viewer, Editor or Admin; use folders and teams
Multi-accountGive the Grafana role cross-account access, or use CloudWatch cross-account observability

Troubleshooting

SymptomLikely cause
No data in AMPCollector lacks aps:RemoteWrite, wrong workspace ID or Region, no network path (private subnet needs NAT or an AMP VPC endpoint)
403 on queriesMissing query permission or wrong SigV4 region
Grafana cannot reach AMP data sourceWorkspace role missing AmazonPrometheusQueryAccess, or data source set to wrong Region
Cost growing quicklyHigh-cardinality labels (user IDs, pod IDs); drop or relabel them at the collector
Alert never reaches emailSNS topic policy missing, subscription unconfirmed

Real World Example

Scenario – unified Kubernetes monitoring. A platform team runs 12 EKS clusters across four accounts. Engineers want node and pod metrics in PromQL and dashboards in Grafana, but the self-hosted Prometheus servers keep running out of disk.

They deploy the AWS managed collector on each cluster and write into a central AMP workspace per environment. Amazon Managed Grafana, authenticated with IAM Identity Center, combines AMP, CloudWatch and X-Ray data sources on shared dashboards. Alerting rules send SLO breaches to an SNS topic that pages on-call. Operational overhead drops to near zero and a cardinality review cuts ingestion cost by 35%.

Architecture Diagram

Managed Prometheus and Grafana pipeline
Architecture
Observability
EKS / ECS workloadsexporters
Managed collector / ADOT
AMP workspacePromQL
Managed Grafanadashboards
SNS
  1. 1Applications expose Prometheus metrics through exporters or client libraries.
  2. 2A managed collector or ADOT scrapes them and signs requests with SigV4.
  3. 3Samples are written to the AMP workspace remote-write endpoint.
  4. 4Managed Grafana queries AMP, CloudWatch and X-Ray from one dashboard.
  5. 5AMP alerting rules publish to SNS to notify on-call engineers.

Best Practices

  • ✓Use the AWS managed collector or ADOT with IRSA / Pod Identity, not static credentials, for remote write.
  • ✓Control label cardinality and scrape intervals to keep ingestion cost predictable.
  • ✓Authenticate Grafana with IAM Identity Center and give most users Viewer or Editor, not Admin.
  • ✓Use VPC endpoints for AMP when collectors run in private subnets without NAT.
  • ✓Send AMP alerts to SNS and test the subscription and topic policy end to end.

Common Interview Questions

Exam Tips

SOA-C03 focus

  • Prometheus-compatible managed metrics -> AMP; managed Grafana dashboards over many data sources -> AMG.
  • AMP alerts are delivered through SNS; ingestion is authenticated with SigV4 and aps:RemoteWrite.
  • Simple AWS-native container metrics and alarms -> CloudWatch Container Insights; PromQL ecosystem -> AMP.
  • Grafana user sign-in -> IAM Identity Center or SAML.

Finished this lesson?

0 of 46 lessons done · 0% of the course