Google Professional Cloud Developer Question 477
Select 3Google Cloud PlatformYou are developing a cloud-native application running on Google Kubernetes Engine (GKE). The application generates custom metrics such as transaction counts and error rates. You need to integrate the application with Google Cloud’s operations suite to monitor these metrics and set up alerts. What steps should you take to achieve this?
- A
Use the Cloud Monitoring API to create custom metrics and send metric data from the application.
- B
Install the Cloud Operations Agent directly in your GKE pods to collect the custom metrics.
- C
Define a Prometheus configuration file and use the Managed Prometheus integration to scrape the custom metrics.
- D
Enable the Cloud Monitoring and Cloud Logging APIs in your Google Cloud project.
- E
Deploy a Stackdriver Logging agent within your application to send metrics to Cloud Monitoring.
Show answer and explanation
Correct answers: A, C, D
Explanation
To integrate custom metrics with Google Cloud’s operations suite, you need to use the Cloud Monitoring API to create and send metrics, set up the Managed Prometheus integration for scraping Kubernetes-based metrics, and ensure the relevant APIs are enabled in your Google Cloud project. These steps collectively allow seamless monitoring and alerting for your custom metrics.
- A. Correct.
Correct: The Cloud Monitoring API is used to create custom metrics and send data from applications. This is a key step in integrating custom metrics with Google Cloud’s operations suite.
- B. Incorrect.
Incorrect: The Cloud Operations Agent is not designed to run directly in GKE pods. Instead, it is typically used for collecting logs and metrics from virtual machines.
- C. Correct.
Correct: Managed Prometheus integration in GKE allows you to scrape custom metrics using Prometheus configurations, making it ideal for Kubernetes environments.
- D. Correct.
Correct: Enabling the Cloud Monitoring and Cloud Logging APIs is mandatory to use Google Cloud’s operations suite for monitoring and logging.
- E. Incorrect.
Incorrect: The Stackdriver Logging agent is not used for sending metrics; it is primarily for capturing logs and sending them to Cloud Logging.