SOA-C03 练习题

SOA-C03 题目讲解:已有 Lambda 日志用 Logs Insights 查询

SOA-C03 练习题讲解。答案 C。问题是过去七天某错误发生次数,日志已经在 CloudWatch。

SOA-C03 免费试练题 · 考证匠讲解

题目

An AWS Lambda function is intermittently failing several times a day. A SysOps administrator must find out how often this error has occurred in the last 7 days. Which action will meet this requirement in the MOST operationally efficient manner?

A. Use Amazon Athena to query the Amazon CloudWatch logs that are associated with the Lambda function.
B. Use Amazon Athena to query the AWS CloudTrail logs that are associated with the Lambda function.
C. Use Amazon CloudWatch Logs Insights to query the associated Lambda function logs.
D. Use Amazon OpenSearch Service (Amazon Elasticsearch Service) to stream the Amazon CloudWatch logs for the Lambda function.

答案

答案 C。问题是过去七天某错误发生次数,日志已经在 CloudWatch。

拆题

  • 问题是过去七天某错误发生次数,日志已经在 CloudWatch。
  • Insights 直接过滤与聚合现有 log group,减少导出与新平台。
  • 要定义一次错误的唯一事件,避免 stack trace 多行或重试把一个业务失败计多次。

每个选项为什么对、为什么错

  • A:Athena 要把日志导出 S3 等额外准备,不如当前 Logs Insights 直接。
  • B:CloudTrail 记录调用审计,未必包含 Lambda 内部应用错误内容。
  • C(正确):Logs Insights 在指定七天窗口查询错误事件,最快利用已有数据。
  • D:先搭 OpenSearch 日志流增加配置与成本,单次统计无需。

放到具体场景里

教学例子:按结构化 level=ERROR 且 errorType=PaymentTimeout 过滤,以 requestId 去重并按一天分组。若只搜索单词 error,日志里的测试文字也可能误算;若只看 Lambda Errors metric,可能漏掉应用捕获后仍返回成功的错误。

检查对象本例条件或动作结果与边界
窗口过去七天时间范围明确
筛选level/errorType避免文本误匹配
计数requestId 去重区别调用与业务失败

遇到同类题的判断顺序

  1. 选择日志组:定位对应函数。
  2. 设七天窗口:统一时区与范围。
  3. 过滤聚合:定义错误与唯一事件。
  4. 抽查样本:确认计数不含重复噪声。
结论:统计前先定义“发生一次”,日志行数不一定等于错误次数。

参考资料

继续练这门考试

同一门考试的免费试练题都附这样的完整讲解,做完再看讲解。