DVA-C02 exam dumps

DVA-C02 practice question 378 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 378

Select 3

You are developing a serverless application using AWS Lambda, and you want to monitor the execution duration and error counts of your functions. Additionally, you need to track a custom metric for the number of specific events processed by the Lambda function. Which approach should you take to achieve this?

  1. A

    Enable AWS Lambda's built-in metrics in Amazon CloudWatch.

  2. B

    Use the AWS SDK to publish a custom metric to Amazon CloudWatch for the specific event count.

  3. C

    Embed logging statements in your Lambda function to monitor execution duration and errors.

  4. D

    Enable X-Ray tracing for the Lambda function to automatically monitor all required metrics.

  5. E

    Use Amazon CloudWatch Embedded Metric Format (EMF) to publish custom metrics directly from the Lambda function.

Show answer and explanation

Correct answers: A, B, E

Explanation

To monitor a Lambda function's execution duration and error counts, you can rely on AWS Lambda's built-in metrics, which are automatically available in Amazon CloudWatch. For custom metrics, such as the number of specific events processed, you can use the AWS SDK to publish custom metrics or leverage the Amazon CloudWatch Embedded Metric Format (EMF) for direct and efficient metric publishing. Logging statements and X-Ray tracing are useful for other purposes but are not the best solutions for the specific requirements in this scenario.

  • A. Correct.

    Correct. AWS Lambda automatically provides built-in metrics such as execution duration and error counts, which are available in Amazon CloudWatch.

  • B. Correct.

    Correct. Using the AWS SDK, you can publish custom metrics, such as the number of specific events processed, to Amazon CloudWatch.

  • C. Incorrect.

    Incorrect. Logging statements are useful for debugging, but they are not a recommended approach to monitor execution duration and errors or to publish custom metrics.

  • D. Incorrect.

    Incorrect. Enabling X-Ray tracing provides detailed insights into application performance but does not replace the need for CloudWatch metrics, nor does it help with custom metrics.

  • E. Correct.

    Correct. The Amazon CloudWatch Embedded Metric Format (EMF) allows you to directly publish custom metrics from a Lambda function to CloudWatch in a structured and efficient manner.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam