Monitoring the Health of All Your Cloud Apps with Stackdriver
StackDriver provides visibility in monitoring, display of cloud-driven applications, uptime, and overall health.
Stackdriver has come up with powerful monitoring, logging, and diagnostics for apps across cloud platforms. It provides you with profound insights into the health, performance, and availability of your cloud-powered apps, enabling you to find and fix issues faster.
Settings are available for system-level as well as app level-monitoring. Is one of the most common DevOps tasks, which makes monitoring one of the key features of the stackdriver.
Stackdriver monitoring collects metrics, event, and metadata from GCP, AWS, and a variety of common application components. You can create an alert and dashboard on this data.
Stackdriver logging allows you to filter, search and view the logs from your code and your cloud provider services.
You can also export these logs into BigQuery, cloud storage, and Pub/Sub for further analysis.
Stackdriver Error Reporting monitors your application's error, aggregates them and then alerts you to any new issue that arises. You can use the error reporting console in order to see the data about instances of these errors, the versions of your apps in which they occurred, and when they were first or last viewed.
How to access the firebase
On your computer, open a Chrome browser.
Go to the https://console.cloud.google.com
Click on add project
Before you begin
To use Stackdriver Monitoring, you need to create a GCP project, enable billing for your project, and connect your project with a Workspace.
To create a project:
In the GCP Console, go to New Project.
In the Project Name field, enter Quickstart.
To enable billing for your project:
In the GCP Consol
e, go to Billing.
Select your Quickstart project if it is not already selected at the top of the page.
You are prompted to choose a current payments profile or to create a new one.
To add your project to the workspace:
In Google Cloud Platform Console, select Stackdriver > Monitoring.
Your project is not in a Workspace. Click on Create a new Workspace and then click Continue.
Select your quickstart project, and then click on Create workspace.
To add a Google Cloud Platform project to monitor the page, click Continue to keep moving forward.
On the Monitor AWS Account page, click on Skip AWS Setup to proceed.
On the Install StackDriver Agents page, click Continue to proceed.
On receiving the report via the Email page, do not select any report, and then click Continue.
When you see the "Finished initial collection!" message, click Launch monitoring.
When you see the "Welcome to Stackdriver Monitoring!" banner and the Stackdriver dashboard, you have successfully generated a Stackdriver workspace.
Create an uptime check
Uptime checks verify that your web server is readily available from locations around the world. The alert policy controls who is notified if the uptime checks should fail.
To create an alerting policy using that you can check:
Go back to the Stackdriver Monitoring console.
If you see an uptime check if you create an invitation on the dashboard, click it. Otherwise, go to Uptime Check> Uptime Check Overview and then click on Add Uptime Check or Create an Uptime Check.
For the new uptime check fill in the following fields:
In the Title field, enter my Uptime check.
In the resource type drop-down list, select the instance.
In the Applies To field, enter Single, lamp-1-vm.
Leave the other fields with their default values.
To verify that your uptime check is working, click Test. If you see a "Connection error - reject" message, you might have not installed the Apache HTTP Server or you might have specified the HTTPS check type rather than HTTP. For other errors, see Verify your uptime check.
When you click Save, the following dialog displays:
Create an alerting policy
In the Uptime Check Made pane, click Create Alerting Policy.
In the Untitled Condition field, get in a title for the alert policy stipulation. All other fields in the conditions pane are automatically populated with the uptime check you created.
In the Notification Channel Type drop-down list, select Email.
Type your email address and then click Add Notification Channel.
In the Name this policy pane, checked My Uptime Check Policy.
Click Save. You see a summary of the policy.
Create a dashboard and chart
Demonstrate the metrics collected by Monitoring in your own charts and dashboards.
In the Stackdriver Monitoring console, go to the Dashboards > Create dashboard.
In the upper-right hand corner, click Add Chart.
In the Add Chart window, click on the Metric tab.
Down Find resource type and metric heading, in the instance, CPU, usage, etc. field, type CPU, and then select CPU load(1m) from the drop-down list. Leave the other fields with their default values.
When a new chart is stuck in the Preview section of the panel, click Save.
To create a second chart, click on Add Chart.
Click the Metric tab.
In the Find resource type and metric drop-down list, click on Received bytes. Leave other fields with their default values.
When a new chart is created in the Preview section, click Save.
In the new dashboard, change the Untitled Dashboard to Stackdriver quickstart dashboard.
Test the check and alert
This procedure can take up to 40 minutes. A sample timeline is associated for your reference. In the timeline, the current time is 12:00.
Return to the Stackdriver Monitoring console. Wait until the icon next to the My Uptime check sees changes from a gray circle with an exclamation mark to a green circle with a check mark. The most wait time for this stage is 25 minutes:
12:15 The My Uptime Check icon is green. Test the check and alert.
Go to the VM Instances page, pick your instance, and click Stop.
12:25 Alert notification received.
Correct the "problem" by restarting the VM. Return to the VM Instances page, type your instance, and click Start.
12:40 Incident Resolved
Received second alert notification.
View your logs
Monitoring and Logging are closely integrated. To view your logs:
In the Stackdriver Monitoring console, click Logging:
Modify the Logs Viewer settings to see the logs you want:
In the first drop-down list, choose GCE VM Instance, lamp-1-vm.
In the second drop-down list, select syslog, and click OK.
Leave the other fields with their default values. The logs from your VM instance display.
Return to the Stackdriver Monitoring console. To view your logs, in one of your charts, click the menu icon, and then click View logs.