Recording and Alerting on SageMaker Endpoint API Call Events with CloudTrail and CloudWatch

Answer Correct answer: C — CloudTrail records every SageMaker endpoint API call event, and a CloudWatch dashboard with an alarm provides the monitoring and threshold notification.

A company has trained and deployed an ML model by using Amazon SageMaker. The company needs to implement a solution to record and monitor all the API call events for the SageMaker endpoint. The solution also must provide a notification when the number of API call events breaches a threshold. Which solution will meet these requirements?

  1. Use SageMaker Debugger to track the inferences and to report metrics. Create a custom rule to provide a notification when the threshold is breached.
  2. Use SageMaker Debugger to track the inferences and to report metrics. Use the tensor_variance built-in rule to provide a notification when the threshold is breached.
  3. Log all the endpoint invocation API events by using AWS CloudTrail. Use an Amazon CloudWatch dashboard for monitoring. Set up a CloudWatch alarm to provide notification when the threshold is breached. Correct Answer
  4. Add the Invocations metric to an Amazon CloudWatch dashboard for monitoring. Set up a CloudWatch alarm to provide notification when the threshold is breached.

Community Votes

C
82%
D
18%

82% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

CloudTrail captures every SageMaker InvokeEndpoint API call as a recordable event, while CloudWatch supplies the dashboard and the alarm; the CloudWatch Invocations metric alone counts calls but does not record the individual API call events.

After deploying a model with SageMaker, the company must record every API call event for the SageMaker endpoint, monitor them, and be notified when the number of calls breaches a threshold. The requirement combines an audit record of all invocation events with metric monitoring and threshold alerting.

Choosing only the CloudWatch Invocations metric. It does give an alarm on call volume, but it does not record the API call events themselves, and the question explicitly requires recording all of them.

Community Discussion (6 comments)

a4002bd 👍 6 Selected: C
I pick C. The company needs to implement a solution to record and monitor all the API call events for the SageMaker endpoint. Its needs to RECORD all events.
eesa 👍 1 Selected: C
C. CloudTrail + CloudWatch dashboard + CloudWatch alarm ✅ Correcto. AWS CloudTrail captura todos los eventos de API, incluidas las invocaciones a endpoints de SageMaker (InvokeEndpoint). CloudWatch puede procesar estos logs para generar métricas personalizadas. Puedes usar un alarm de CloudWatch para notificar cuando el número de eventos supera un umbral. Esto cubre tanto registro como notificación
eesa 👍 1 Selected: C
✅ Breakdown of the correct answer: CloudTrail: Logs all SageMaker API calls, including InvokeEndpoint. Provides auditing and visibility into who called the endpoint, when, and with what parameters. Essential for tracking all invocation events (as required). CloudWatch Dashboard + Alarm: Use a CloudWatch dashboard to monitor invocation patterns and metrics. Set up an alarm based on metrics like the number of invocations (from CloudTrail logs or the Invocations metric) to trigger notifications when thresholds are breached.
abrarjahin 👍 1 Selected: D
Cloud trail is not an option for real time solution
lyndonZhao 👍 1 Selected: D
CloudWatch Invocations metric: This metric tracks the number of API calls made to a SageMaker endpoint. By adding this metric to a CloudWatch dashboard and setting up an alarm, you can monitor the number of API calls and receive notifications when the threshold is breached.
Saransundar 👍 1 Selected: C
SageMaker endpoint API calls → Record with CloudTrail → Monitor metrics in CloudWatch → CloudWatch alarm for notifications

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The requirement has two halves: record all API call events for the SageMaker endpoint, and notify when the event count breaches a threshold. AWS CloudTrail logs the management API activity, including InvokeEndpoint calls, which satisfies the recording requirement with a full event history. Amazon CloudWatch then provides the dashboard for monitoring and the alarm for threshold notification, so option C is the only answer covering both halves. The vote was strong at 82 for C, and a4002bd highlighted that the company needs to record all events, with eesa describing the CloudTrail plus CloudWatch dashboard and alarm combination in detail.

Why the Other Options Are Wrong

SageMaker Debugger with a custom rule (A) inspects model training and inference tensors and can report metrics, but it is built for debugging model internals rather than recording endpoint API call events, and rule-based thresholding on tensor metrics is not the same as counting API invocations. The tensor_variance built-in rule (B) is a specific statistical check on tensor values, so it has no relationship to API call volume and cannot serve as a threshold notification for endpoint traffic. The CloudWatch Invocations metric alone (D) does track invocation counts and can drive an alarm, but a metric is an aggregate number, not a record of the API call events, so it fails the explicit recording requirement that CloudTrail satisfies.

Community Comment Notes

The community favored C overwhelmingly, 82 to 18. abrarjahin and lyndonZhao argued for D on the grounds that the Invocations metric is simpler and CloudTrail is not real time, but eesa and Saransundar answered that CloudWatch alarms can be driven from metrics derived on CloudTrail logs, satisfying both recording and notification. The dissent is a real design tradeoff about real-time versus recorded events, not a factual error in option C.

Official Reference

Related Analysis

Practice All MLA-C01 Questions

Access 115 questions with complete answers and detailed explanations.

View Full MLA-C01 Practice Test →

← Back to MLA-C01 Study Guide