Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 250 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 250
Topic #: 1
[All Professional Cloud Developer Questions]

You have an application running on Google Kubernetes Engine (GKE). The application is currently using a logging library and is outputting to standard output. You need to export the logs to Cloud Logging, and you need the logs to include metadata about each request. You want to use the simplest method to accomplish this. What should you do?

  • A. Change your application’s logging library to the Cloud Logging library, and configure your application to export logs to Cloud Logging.
  • B. Update your application to output logs in JSON format, and add the necessary metadata to the JSON.
  • C. Update your application to output logs in CSV format, and add the necessary metadata to the CSV.
  • D. Install the Fluent Bit agent on each of your GKE nodes, and have the agent export all logs from /var/log.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
aldi22
Highly Voted 1 year, 7 months ago
The answer is B since GKE is integrated with Cloud Logging by default. "By default, GKE clusters are natively integrated with Cloud Logging (and Monitoring). When you create a GKE cluster, both Monitoring and Cloud Logging are enabled by default." "GKE deploys a per-node logging agent that reads container logs, adds helpful metadata, and then sends the logs to the logs router, which sends the logs to Cloud Logging and any of the Logging sink destinations that you have configured. Cloud Logging stores logs for the duration that you specify or 30 days by default. Because Cloud Logging automatically collects standard output and error logs for containerized processes, you can start viewing your logs as soon as your application is deployed." Source: https://cloud.google.com/blog/products/management-tools/using-logging-your-apps-running-kubernetes-engine
upvoted 12 times
...
anshad666
Most Recent 1 month ago
Selected Answer: B
easy way
upvoted 1 times
...
cloud_unicorn_99
2 months, 3 weeks ago
Selected Answer: B
This question is from the Google Official Example Questions, B is the correct answer because it is the easiest way.
upvoted 1 times
...
d_ella2001
4 months, 1 week ago
Selected Answer: B
B is correct because it’s the easiest way to get a rich format into Cloud Logging. GKE automatically forwards logs sent to stdout to Cloud Logging. As long as it has the right JSON format, Cloud Logging will ingest the rich message
upvoted 3 times
d_ella2001
4 months, 1 week ago
answer from google practice exam
upvoted 1 times
d_ella2001
4 months, 1 week ago
Feedback B is correct because it’s the easiest way to get a rich format into Cloud Logging. GKE automatically forwards logs sent to stdout to Cloud Logging. As long as it has the right JSON format, Cloud Logging will ingest the rich message A is not correct because it would require a lot of extra work to replace the library, and replicate the extra information (such as pod name) that the GKE logs exporter automatically provides. D is not correct because this is only needed for pods (normally special/privileged pods) that write directly to the GKE file system. C is not correct because Cloud Logging doesn’t support ingesting CSV.
upvoted 1 times
...
...
...
pico
5 months, 2 weeks ago
Selected Answer: A
Enhanced Metadata: The Cloud Logging library can automatically include valuable metadata about each request, such as request ID, user agent, and resource information. why not B. Update your application to output logs in JSON format, and add the necessary metadata to the JSON: While this is possible, it requires more manual effort to format logs and ensure all the necessary metadata is included.
upvoted 1 times
...
JonathanSJ
9 months, 3 weeks ago
Selected Answer: B
I will go for B. In Google Kubernetes Engine (GKE), the standard output (stdout) of containers is automatically sent to Cloud Logging. This means that if your application in GKE prints logs to standard output, these logs will be captured and can be viewed in Cloud Logging without additional configuration. And if the logs are in JSON is better for processing. Option A is irrelevant because the logs have been sent already to cloud logging via standar output.
upvoted 3 times
...
Kadhem
11 months ago
Selected Answer: A
since we need to update the application, the best solution between A, B and C is A.
upvoted 2 times
...
82e0b6209c
11 months, 3 weeks ago
Selected Answer: B
B for me: we're looking for the simplest method and I feel it's easier to configure the existing library to output JSON and include some context metadata rather than changing every log statement to use Cloud Logging library.
upvoted 2 times
...
purushi
1 year, 3 months ago
Selected Answer: A
The key here is "use the simplest method to accomplish this...", using Cloud logging library is a very simple and straight forward solution. If the app is running on the single and multiple VMs in a instance group, then installing the cloud logging agent must be the correct answer. This environment is GKE cluster and separate some normal VM workflow.
upvoted 1 times
82e0b6209c
11 months, 3 weeks ago
How is it simpler to change every logging statement to use a different library rather than configuring the existing one to ouput in JSON and automatically append context metadata? I'd go for B
upvoted 1 times
...
...
closer89
1 year, 7 months ago
Selected Answer: A
to log request metadata https://cloud.google.com/logging/docs/reference/libraries#write_request_logs
upvoted 1 times
...
Pime13
1 year, 8 months ago
took my exam yesterday (01-03-2023) and this question was there
upvoted 2 times
...
Pime13
1 year, 9 months ago
Selected Answer: A
When you write logs from your service or job, they will be picked up automatically by Cloud Logging so long as the logs are written to any of these locations: Standard output (stdout) or standard error (stderr) streams Any files under the /var/log directory syslog (/dev/log) Logs written using Cloud Logging client libraries, which are available for many popular languages https://cloud.google.com/run/docs/logging#container-logs
upvoted 1 times
Pime13
1 year, 9 months ago
https://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs#what_logs
upvoted 1 times
...
...
mrvergara
1 year, 9 months ago
Selected Answer: A
Option D, installing the Fluent Bit agent on each of your GKE nodes, is not the most straightforward method for exporting logs to Cloud Logging, as it requires manual configuration and management of the Fluent Bit agent. While Fluent Bit can be used to collect and forward logs to Cloud Logging, it is typically used for more complex logging scenarios where custom log processing is required. Using the Cloud Logging library, as described in Option A, is a simpler and more direct method for exporting logs to Cloud Logging, as it eliminates the need to manage an additional log agent and provides a more integrated solution for logging in a GKE environment.
upvoted 4 times
...
TNT87
1 year, 9 months ago
https://cloud.google.com/blog/products/management-tools/using-logging-your-apps-running-kubernetes-engine
upvoted 1 times
...
TNT87
1 year, 9 months ago
Selected Answer: D
https://cloud.google.com/run/docs/logging#container-logs
upvoted 1 times
TNT87
1 year, 9 months ago
Answer A not D
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...