PROFESSIONAL-CLOUD-DEVOPS-ENGINEER · Question #105
PROFESSIONAL-CLOUD-DEVOPS-ENGINEER Question #105: Real Exam Question with Answer & Explanation
The correct answer is D: Configure the log agent to convert log text payload to JSON payload.. Cloud Logging's log router supports log-based transformations. Configuring the log agent (or log router/sink configuration) to parse and convert text payloads to JSON structured payloads allows you to achieve structured logging without modifying application source code. This mini
Question
Your Cloud Run application writes unstructured logs as text strings to Cloud Logging. You want to convert the unstructured logs to JSON-based structured logs. What should you do?
Options
- AModify the application to use Cloud Logging software development kit (SDK), and send log
- BInstall a Fluent Bit sidecar container, and use a JSON parser.
- CInstall the log agent in the Cloud Run container image, and use the log agent to forward logs to
- DConfigure the log agent to convert log text payload to JSON payload.
Explanation
Cloud Logging's log router supports log-based transformations. Configuring the log agent (or log router/sink configuration) to parse and convert text payloads to JSON structured payloads allows you to achieve structured logging without modifying application source code. This minimizes development effort and keeps the logging concern separate from the application logic. Option A (Cloud Logging SDK) also produces structured logs and is a valid approach, but it requires modifying and redeploying the application code. Option B (Fluent Bit sidecar) is a viable pattern in Cloud Run when multiple containers are supported, but it adds operational complexity. Option C is not applicable to Cloud Run since Cloud Run is a fully managed platform where you cannot install a traditional VM-based logging agent directly into the managed runtime.
Topics
Community Discussion
No community discussion yet for this question.