Operators struggle to query free-text Lambda logs for citizenId, action, and latencyMs. What logging change helps CloudWatch Logs Insights?
Select an answer to reveal the explanation.
Short Explanation
Free-text novels fight Insights. Structured JSON with citizenId, action, and latencyMs turns log search into fielded queries operators can trust.
Full Explanation
When operators struggle to query free-text Lambda logs for citizenId, action, and latencyMs, the logging change that helps CloudWatch Logs Insights is emitting structured JSON logs with those fields. Named fields enable reliable filter and stats queries instead of brittle string scraping across inconsistent prose. Municipal support and performance reviews both benefit from consistent structure.
Keeping only unstructured prose paragraphs with no field names makes Insights queries fragile and slow.
Writing binary protobuf blobs to CloudWatch without a JSON option blocks standard Insights field extraction.
Logging exclusively to local /tmp files hides data from CloudWatch Logs Insights entirely.
Exam caveat: Structured logging is a first-class recommendation for Insights-friendly observability on Associate exams.
Operational check: Adopt a JSON logger with citizenId, action, and latencyMs, deploy to a test alias, run Insights queries grouping latency by action, and confirm operators can answer complaint queries without downloading raw files. Keep the civic/municipal context in mind: citizen support SLAs depend on finding one citizenId among high-volume Lambda logs quickly. Document the finding in the municipal incident ticket so the next on-call engineer inherits evidence rather than folklore.