After installing the Stackdriver Logging Agent, what should you do first?

You want to use the Stackdriver Logging Agent to send an application’s log file to Stackdriver from a Compute Engine virtual machine instance.

After installing the Stackdriver Logging Agent, what should you do first?
A . Enable the Error Reporting API on the project.
B . Grant the instance full access to all Cloud APIs.
C . Configure the application log file as a custom source.
D . Create a Stackdriver Logs Export Sink with a filter that matches the application’s log entries.

Answer: B

What should you do?

You plan to make a simple HTML application available on the internet. This site keeps information about FAQs for your application. The application is static and contains images, HTML, CSS, and Javascript. You want to make this application available on the internet with as few steps as possible.

What should you do?
A . Upload your application to Cloud Storage.
B . Upload your application to an App Engine environment.
C . Create a Compute Engine instance with Apache web server installed. Configure Apache web server to host the application.
D . Containerize your application first. Deploy this container to Google Kubernetes Engine (GKE) and assign an external IP address to the GKE pod hosting the application.

Answer: A

Explanation:

Reference: https://cloud.google.com/storage/docs/hosting-static-website

What should you do next?

Your application is running on Compute Engine and is showing sustained failures for a small number of requests. You have narrowed the cause down to a single Compute Engine instance, but the instance is unresponsive to SSH.

What should you do next?
A . Reboot the machine.
B . Enable and check the serial port output.
C . Delete the machine and create a new one.
D . Take a snapshot of the disk and attach it to a new machine.

Answer: A

How should you configure your application to retrieve Spanner credentials?

You are developing a microservice-based application that will be deployed on a Google Kubernetes Engine cluster. The application needs to read and write to a Spanner database. You want to follow security best practices while minimizing code changes.

How should you configure your application to retrieve Spanner credentials?
A . Configure the appropriate service accounts, and use Workload Identity to run the pods.
B . Store the application credentials as Kubernetes Secrets, and expose them as environment variables.
C . Configure the appropriate routing rules, and use a VPC-native cluster to directly connect to the database.
D . Store the application credentials using Cloud Key Management Service, and retrieve them whenever a database connection is made.

Answer: A

Explanation:

https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity

How should you configure your application to retrieve Spanner credentials?

You are developing a microservice-based application that will be deployed on a Google Kubernetes Engine cluster. The application needs to read and write to a Spanner database. You want to follow security best practices while minimizing code changes.

How should you configure your application to retrieve Spanner credentials?
A . Configure the appropriate service accounts, and use Workload Identity to run the pods.
B . Store the application credentials as Kubernetes Secrets, and expose them as environment variables.
C . Configure the appropriate routing rules, and use a VPC-native cluster to directly connect to the database.
D . Store the application credentials using Cloud Key Management Service, and retrieve them whenever a database connection is made.

Answer: A

Explanation:

https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity

What should you do?

You deployed a new application to Google Kubernetes Engine and are experiencing some performance degradation. Your logs are being written to Cloud Logging, and you are using a Prometheus sidecar model for capturing metrics. You need to correlate the metrics and data from the logs to troubleshoot the performance issue and send real-time alerts while minimizing costs.

What should you do?
A . Create custom metrics from the Cloud Logging logs, and use Prometheus to import the results using the Cloud Monitoring REST AP
C . Export the Cloud Logging logs and the Prometheus metrics to Cloud Bigtable. Run a query to join the results, and analyze in Google Data Studio.
D . Export the Cloud Logging logs and stream the Prometheus metrics to BigQuery. Run a recurring query to join the results, and send notifications using Cloud Tasks.
E . Export the Prometheus metrics and use Cloud Monitoring to view them as external metrics. Configure Cloud Monitoring to create log-based metrics from the logs, and correlate them with the Prometheus data.

Answer: D

Explanation:

Reference: https://cloud.google.com/blog/products/operations/troubleshoot-gke-faster-with-monitoring-data-in-your-logs

Which improvement should you suggest your teammate make?

Your teammate has asked you to review the code below, which is adding a credit to an account balance in Cloud Datastore.

Which improvement should you suggest your teammate make?

A . Get the entity with an ancestor query.
B . Get and put the entity in a transaction.
C . Use a strongly consistent transactional database.
D . Don’t return the account entity from the function.

Answer: A

Which Google Cloud feature should you use to invoke the backend services?

You manage an application that runs in a Compute Engine instance. You also have multiple backend services executing in stand-alone Docker containers running in Compute Engine instances. The Compute Engine instances supporting the backend services are scaled by managed instance groups in multiple regions. You want your calling application to be loosely coupled. You need to be able to invoke distinct service implementations that are chosen based on the value of an HTTP header found in the request.

Which Google Cloud feature should you use to invoke the backend services?
A . Traffic Director
B . Service Directory
C . Anthos Service Mesh
D . Internal HTTP(S) Load Balancing

Answer: D