We all are familiar with google cloud console. We have used it for different projects. But the problem arises with how to manage the metrics when working on a google project. So for that we have learnt about the concept of the metric in cloud monitoring. So now in this blog we’ll learn about the Advanced concepts of metrics in cloud monitoring.
So let's dive in more to learn about this topic.
Cloud Monitoring
Cloud Monitoring gathers data from hosted uptime probes, application instrumentation, Google Cloud, Amazon Web Services (AWS), and events.
By default, a Google Cloud project has visibility only to the metrics it can store. However, you can expand the set of metrics that a project can be accessible by adding other Google Cloud projects to the project's metrics scope. The metrics scope defines the set of the Google Cloud projects whose metrics the current Google Cloud project can access.
A scoping project hosts the metrics scope.
Information regarding the scope of the metric is kept in the scoping project. Additionally, you can configure it to store the alarms, uptime checks, dashboards, and monitoring groups for the metrics scope.
For example, consider the scenario when two Cloud projects are included in the metrics scope of a scoping project. The policy watches the metrics in the two projects when an alerting policy is created in the scoping project for that metrics scope.
AWS connector projects
A Google Cloud project called an AWS connection project enables Cloud Monitoring to read metrics for a particular AWS account. A Google Cloud project with an AWS connection project as a monitored project is shown in the diagram below. The project's AWS connection reads metrics from an AWS account and stores them:
Setup before you begin
Having an AWS account is required.
To make your AWS connection projects identifiable, decide on a naming scheme. We advise including identifying information about the AWS account it monitors in the project name of an AWS connector. The AWS account that an AWS connection project is watching cannot be changed.
Check to see if Google Cloud is connected to your AWS account.
Make sure you have all the necessary permissions to build a Google Cloud project and that Identity and Access Management (IAM) role on scoping project allows you to adjust its metrics scope:
Connecting your AWS account to Google Cloud
1. Select Monitoring from the Google Cloud console or press the following button:
2. To examine or change the metrics scope of a Cloud project, use the project picker in the Google Cloud console.
3. Click on >Expand on the Metrics scope field of Monitoring navigation pane.
The page that appears when the AllEnvironments project is selected is depicted in the next screenshot:
Additionally, it demonstrates that this project consists of two monitored projects, Staging, and Production.
Selecting a different metrics scope
Use the project picker in the Google Cloud console to choose a different project if you want to choose a different metrics scope.
Now let's have a look at View metrics for AWS accounts
Viewing metrics for AWS accounts
In this, we are going to learn how to use Cloud Monitoring to view and track metrics from Amazon EC2.
Stopping ingestion of AWS account metrics
Delete the AWS connector project for the account to halt the ingestion of metrics and logs from that AWS account.
Manage metrics scopes by using the API
In this, we are going to learn about how to manage the metrics scope of a Google Cloud project using the metrics scope methods in the Cloud Monitoring API.
curl command parameters
The metrics scopes APIs are immediately accessible. On this page, you may find examples of curl commands. The URL of an API resource is followed by a set of arguments in each curl command:
The Cloud Monitoring API's metrics scope methods that alter the system's state, such as the command to add a monitored project to a metrics scope, are all asynchronous. The command response for these commands is an Operation object.
Send a GET request to the operation.get to update the information on the status
To disable the Cloud Monitoring API in your current project, enter the following command:
gcloud services disable monitoring.googleapis.com
Frequently Asked Questions
What is called a cloud?
The term "the cloud" describes the software and databases that run on servers that may be accessed via the Internet.
What is the Cloud Controls Matrix?
The Cloud Controls Matrix (CCM) from the Cloud Security Alliance is a tool created expressly to help potential cloud customers and cloud vendors analyze the overall security risk of a cloud provider.
What is an Asynchronous method?
The execution of an asynchronous method occurs in a separate thread from the main application thread.
What is cloud bursting?
Hybrid clouds are related to cloud bursting. The notion is that a certain application typically runs in a local computer environment or a private cloud.
What is IAM?
Identity and access management (IAM) is a centralized and consistent method to automate access controls, maintain user identities, and adhere to compliance standards in both traditional and containerized settings.
Conclusion
This blog has extensively discussed Advanced concepts of metrics in cloud monitoring, AWS connector projects, Disabled the Cloud Monitoring API, etc. We hope this blog has helped you in enhancing your knowledge about Advanced concepts of metrics in cloud monitoring. If you want to learn more, check out the excellent content on the Coding Ninjas Website: Key concepts of cloud logging
Refer to our guided paths on the Coding Ninjas Studio platform to learn more about DSA, DBMS, Competitive Programming, Python, Java, JavaScript, etc.