AWS Systems Architect Professional

AWS X-Ray, Managed Prometheus, and Grafana – SAP-C02 Study Guide

Learn how AWS X-Ray, Amazon Managed Service for Prometheus, and Amazon Managed Grafana support distributed tracing, metrics analysis, dashboards, and alerting for SAP-C02 scenarios.

AWS Systems Architect ProfessionalAWS Systems Architect ProfessionalUpdated Sep 1, 2026
Study options
WatchComing later
ListenComing later
ReadAvailable
ReviewComing later

Study guide

Technical reference and lesson notes

Purpose of This Lesson

Modern applications often consist of multiple services, containers, functions, databases, and messaging components. Traditional host-level metrics may show that an application is slow, but they do not necessarily explain which service or dependency is responsible.

AWS provides several complementary observability tools:

  • AWS X-Ray for distributed request tracing and service maps.
  • Amazon Managed Service for Prometheus for collecting, querying, and alerting on time-series metrics, especially from containerized workloads.
  • Amazon Managed Grafana for interactive dashboards and visualization of metrics, logs, and traces from multiple data sources.

Understanding the role of each service is more important for the exam than memorizing implementation details.

Key Concepts

AWS X-Ray: Distributed Tracing

AWS X-Ray follows requests as they move through application components. It helps teams:

  • Visualize application dependencies with a service map.
  • Identify latency and performance bottlenecks.
  • Troubleshoot failed or slow requests.
  • Analyze behavior across microservices, databases, queues, and other dependencies.

A trace can show a request entering a Lambda function, calling Amazon DynamoDB or Amazon Rekognition, and returning a response. Latency and error information can be examined for each part of the request path rather than only at the application’s outer boundary.

X-Ray is particularly useful when an application is distributed across services such as:

  • Amazon EC2
  • Amazon ECS
  • AWS Lambda
  • AWS Elastic Beanstalk
  • Amazon DynamoDB
  • Amazon RDS or Amazon Aurora
  • Amazon SQS and Amazon SNS

Applications generally use the X-Ray SDK to instrument code. Depending on the deployment environment, an X-Ray daemon or agent collects segment data and forwards it to the X-Ray service. The SDK and daemon/agent work together to produce and transmit trace information.

X-Ray can capture metadata associated with calls to supported databases and AWS services. It is not a replacement for application logs or infrastructure metrics; it complements them by showing the path and timing of individual requests.

Amazon Managed Service for Prometheus

Amazon Managed Service for Prometheus (AMP) is a fully managed service based on the open-source Prometheus monitoring system and time-series database.

AMP is designed for operational metrics, particularly metrics generated by containerized applications and Kubernetes environments. It supports:

  • Prometheus-compatible metrics ingestion.
  • Prometheus APIs and PromQL queries.
  • Metrics collection from Amazon EKS and Amazon ECS workloads.
  • Alerting and recording rules.
  • Integration with the AWS Distro for OpenTelemetry.
  • Managed scaling for metric ingestion, storage, querying, and alerting.

The service removes much of the operational burden associated with running Prometheus yourself. AWS manages the underlying service capacity as metric volume and workload size change.

AMP is primarily a metrics platform. It is not the same as X-Ray, which focuses on request traces, and it is not a general-purpose dashboarding service like Grafana.

Amazon Managed Grafana

Amazon Managed Grafana (AMG) is a fully managed visualization and analytics service based on Grafana. It can connect to multiple observability data sources and provide dashboards for:

  • Metrics
  • Logs
  • Traces
  • Operational and application data

Grafana can visualize and analyze data from services such as X-Ray, Amazon Managed Service for Prometheus, Amazon CloudWatch, and other supported sources. It can also be used to configure alerts based on the data exposed by those sources.

Amazon Managed Grafana supports enterprise identity integration, including:

  • AWS IAM Identity Center, formerly AWS Single Sign-On.
  • SAML-based identity providers.

This makes it suitable for organizations that need centralized access control for monitoring dashboards.

How the Services Fit Together

These services address different observability needs:

  1. An application emits traces through X-Ray instrumentation.
  2. Containerized workloads expose operational metrics to Prometheus.
  3. Amazon Managed Grafana connects to X-Ray, AMP, CloudWatch, and other sources.
  4. Engineers use Grafana dashboards to correlate latency, errors, traces, and metrics.

For example, a dashboard might show elevated application latency from X-Ray alongside increased CPU utilization or request rates from Prometheus. The combination helps identify whether the cause is an application dependency, resource saturation, or an increase in workload volume.

Exam-Relevant Takeaways

  • AWS X-Ray provides distributed tracing, service maps, trace summaries, latency analysis, and error troubleshooting.
  • X-Ray is especially valuable for microservices and distributed applications where a request crosses multiple components.
  • X-Ray requires application instrumentation, typically using the X-Ray SDK, along with a daemon or agent that forwards trace data.
  • Amazon Managed Service for Prometheus is a managed, Prometheus-compatible service for time-series operational metrics.
  • AMP supports PromQL, Prometheus APIs, alerting, and integrations with EKS, ECS, and AWS Distro for OpenTelemetry.
  • Amazon Managed Grafana provides dashboards and visualization across multiple data sources, including metrics, logs, and traces.
  • Grafana is a visualization and analytics layer; it does not replace the underlying metrics or tracing systems.
  • Use X-Ray when the question emphasizes request flow, service dependencies, distributed latency, or tracing errors.
  • Use AMP when the question emphasizes Prometheus metrics, PromQL, Kubernetes/container monitoring, or managed time-series ingestion.
  • Use Managed Grafana when the question emphasizes dashboards, visualization, centralized analytics, or combining data from several observability sources.

Architecture Decision Guide

RequirementBest fitReason
Follow one request across Lambda, containers, databases, and messaging servicesAWS X-RayProvides distributed traces and service maps
Find which downstream dependency adds latencyAWS X-RayBreaks request timing down across application components
Collect and query Prometheus-compatible container metricsAmazon Managed Service for PrometheusManaged Prometheus storage, APIs, PromQL, and alerting
Monitor Kubernetes workloads using Prometheus conventionsAmazon Managed Service for PrometheusIntegrates with EKS and Prometheus tooling
Build dashboards combining traces, metrics, and logsAmazon Managed GrafanaProvides centralized visualization across data sources
Provide managed Grafana dashboards with enterprise authenticationAmazon Managed GrafanaSupports IAM Identity Center and SAML integration
Run a self-managed Prometheus server with full infrastructure controlSelf-managed PrometheusAppropriate when operational control is more important than managed-service convenience

Common Exam Traps

  • Confusing tracing with metrics: X-Ray follows individual requests and their dependency paths. Prometheus stores and queries time-series metrics.
  • Treating Grafana as a data collection service: Grafana primarily visualizes and analyzes data from configured sources. It is not a substitute for X-Ray or AMP.
  • Assuming X-Ray automatically instruments every application: Application instrumentation and the relevant SDK or agent/daemon configuration are required.
  • Choosing X-Ray for general host monitoring: X-Ray is intended for distributed request tracing, not broad EC2 operating-system metrics collection.
  • Choosing AMP for trace-level troubleshooting: Prometheus metrics can show that latency or error rates increased, but X-Ray is better for following the path of an individual request.
  • Assuming Prometheus and Grafana are interchangeable: Prometheus is primarily a metrics collection, storage, query, and alerting platform. Grafana is primarily a visualization and analytics platform.
  • Ignoring authentication requirements for dashboards: Managed Grafana can integrate with IAM Identity Center and SAML, which is important when centralized user access is required.

Real-World Engineer Notes

  • Use multiple observability signals together. A trace can identify the slow dependency, while metrics can reveal whether the dependency is overloaded and logs can provide detailed error context.
  • Distributed tracing adds instrumentation and data-processing overhead. Apply sampling and retention strategies appropriate to the application’s diagnostic needs and cost constraints.
  • Prometheus metric cardinality can grow rapidly when labels contain high-cardinality values such as request IDs or unbounded user identifiers. Design metric labels carefully.
  • Centralized Grafana dashboards should be organized around operational questions, such as service health, dependency latency, error rate, and saturation, rather than simply displaying every available metric.
  • Access to dashboards and observability data should follow least-privilege principles. Monitoring data may expose resource names, request details, or application behavior.
  • For production systems, define alerts around meaningful symptoms and service-level objectives instead of alerting on every individual metric fluctuation.

Quick Reference Summary

  • X-Ray: Distributed tracing, service maps, request-level latency, dependency analysis, and error troubleshooting.
  • AMP: Managed Prometheus metrics, PromQL, time-series storage, ingestion, querying, and alerting.
  • Managed Grafana: Dashboards and analytics for metrics, logs, traces, and other data sources.
  • X-Ray SDK plus daemon/agent: Instruments applications and forwards trace segments.
  • AMP integrations: EKS, ECS, and AWS Distro for OpenTelemetry.
  • Grafana authentication: IAM Identity Center and SAML-supported enterprise identity integration.
  • Selection rule: Trace requests with X-Ray, analyze Prometheus metrics with AMP, and visualize multiple sources with Grafana.

Flashcards

  1. Q: What problem does AWS X-Ray solve?

A: It provides distributed tracing so teams can follow requests across application components, identify bottlenecks, and troubleshoot errors.

  1. Q: What is an X-Ray service map?

A: A visual representation of application components and their relationships, including request flow, latency, and errors.

  1. Q: Which AWS service provides managed Prometheus functionality?

A: Amazon Managed Service for Prometheus.

  1. Q: What query language does Amazon Managed Service for Prometheus support?

A: PromQL, the open-source Prometheus Query Language.

  1. Q: Which workloads are commonly monitored with Amazon Managed Service for Prometheus?

A: Containerized workloads, including those running on Amazon EKS and Amazon ECS.

  1. Q: What is the primary role of Amazon Managed Grafana?

A: Providing managed dashboards, visualization, analytics, and alerting across multiple data sources.

  1. Q: Can Managed Grafana visualize X-Ray data?

A: Yes. X-Ray can be configured as a data source for Grafana dashboards and analysis.

  1. Q: What is the difference between a trace and a metric?

A: A trace follows an individual request through a distributed system, while a metric is a numerical time-series measurement such as latency, CPU utilization, or request count.

  1. Q: What components typically enable an application to send data to X-Ray?

A: The application uses the X-Ray SDK for instrumentation, and an X-Ray daemon or agent forwards segment data to the X-Ray service.

  1. Q: Which service is best for querying Prometheus-compatible container metrics?

A: Amazon Managed Service for Prometheus.

Practice Questions

Question 1

A company runs a serverless image-processing workflow. An API request invokes a Lambda function, which calls Amazon Rekognition and then stores results in DynamoDB. Some requests are slow, but CloudWatch metrics do not show which dependency is responsible. Which service should the company use?

Correct answer: AWS X-Ray

Explanation: X-Ray provides distributed request tracing and a service map, allowing the company to see the request path and latency associated with the Lambda function, Rekognition, and DynamoDB. Prometheus and Grafana alone do not provide the same request-level dependency tracing.

Question 2

A platform team runs containerized applications on Amazon EKS and wants a managed service that supports PromQL, Prometheus-compatible metrics ingestion, and alerting without operating its own Prometheus servers. Which service meets the requirement?

Correct answer: Amazon Managed Service for Prometheus

Explanation: AMP is a managed Prometheus-compatible service designed for time-series metrics, querying with PromQL, and alerting. It integrates with EKS and removes much of the infrastructure management required by self-hosted Prometheus.

Question 3

An enterprise wants a single monitoring portal with dashboards that combine Amazon Managed Service for Prometheus metrics, AWS X-Ray traces, and CloudWatch data. Users must authenticate through the organization’s central identity provider using SAML. Which service is most appropriate?

Correct answer: Amazon Managed Grafana

Explanation: Managed Grafana provides centralized dashboards and can visualize data from multiple observability sources. It supports enterprise authentication integrations including SAML.

Question 4

A team observes a sudden increase in application latency. Prometheus metrics show that latency increased, but the team needs to determine which downstream service caused the delay for individual requests. Which approach is best?

Correct answer: Instrument the application with the AWS X-Ray SDK and use X-Ray traces.

Explanation: Metrics identify trends and aggregate behavior. X-Ray traces show the path of individual requests and the time spent in downstream services, making it appropriate for dependency-level latency investigation.

Question 5

A company is deciding whether to use Prometheus or Grafana for a new container monitoring platform. It needs to store and query time-series metrics using PromQL and then display those metrics in dashboards. Which design is most appropriate?

Correct answer: Use Amazon Managed Service for Prometheus for metric collection and querying, with Amazon Managed Grafana for visualization.

Explanation: AMP provides the managed Prometheus capabilities, including ingestion, time-series storage, PromQL, and alerting. Managed Grafana provides the dashboard and visualization layer. The services are complementary rather than mutually exclusive.