Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a tutorial on creating a simple Grafana dashboard #5251

Merged
merged 10 commits into from Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 82 additions & 0 deletions docs/monitoring/08-02-create-and-configure-grafana-dashboard.md
@@ -0,0 +1,82 @@
---
title: Create a Grafana dashboard
type: Tutorials
---

This tutorial shows how to create and configure a basic Grafana dashboard of a [Gauge](https://grafana.com/docs/features/panels/singlestat/#gauge) type. The dashboard shows how the values of the `cpu_temperature_celsius` metric change in time, representing the current processor temperature ranging from `60` to `90` Celsius degrees. The dashboard shows explicitly when the CPU temperature exceeds the pre-defined threshold of `75` Celsius degrees.

## Prerequisites

This tutorial is a follow-up of the [**Observe application metrics**](#tutorials-observe-application-metrics) tutorial that uses the `monitoring-custom-metrics` example. This example deploys the `sample-metrics-8081` service which exposes the `cpu_temperature_celsius` metric. That configuration is required to complete this tutorial.

## Steps

Access the Grafana UI, select the `cpu_temperature_celsius` metric, the Gauge dashboard type, and start the configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Access the Grafana UI, select the `cpu_temperature_celsius` metric, the Gauge dashboard type, and start the configuration.
Access the Grafana UI, select the `cpu_temperature_celsius` metric and the Gauge dashboard type, and start the configuration.

or

Suggested change
Access the Grafana UI, select the `cpu_temperature_celsius` metric, the Gauge dashboard type, and start the configuration.
Follow these guidelines to access the Grafana UI and create, configure, and test a Gauge type dashboard for the `cpu_temperature_celsius` metric.

🤔 still not perfect, what I mean is that not all the steps are mentioned in the section - testing is not (but it's actually only about refreshing the browser so maybe it’s not needed here).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I will think about improving that.

Copy link
Author

@kazydek kazydek Aug 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that ok? Follow these sections to create the Gauge dashboard type for the `cpu_temperature_celsius` metric.


### Create the dashboard

1. Navigate to Grafana. It is available under the `https://grafana.{DOMAIN}` address, where `{DOMAIN}` is the domain of your Kyma cluster, such as `https://grafana.34.63.57.190.xip.io` or `https://grafana.nightly.a.build.kyma-project.io/`. You can also access it by clicking on **Stats & Metrics** on the left navigation menu in the Console UI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Navigate to Grafana. It is available under the `https://grafana.{DOMAIN}` address, where `{DOMAIN}` is the domain of your Kyma cluster, such as `https://grafana.34.63.57.190.xip.io` or `https://grafana.nightly.a.build.kyma-project.io/`. You can also access it by clicking on **Stats & Metrics** on the left navigation menu in the Console UI.
1. Navigate to Grafana. It is available under the `https://grafana.{DOMAIN}` address, where `{DOMAIN}` is the domain of your Kyma cluster, such as `https://grafana.34.63.57.190.xip.io` or `https://grafana.nightly.a.build.kyma-project.io/`. To access it from the Console UI, click **Stats & Metrics** on the left navigation menu.


![Stats and Metrics](./assets/stats-and-metrics.png)

2. Click the **+** icon on the left sidebar and select **Dashboard** from the **Create** menu.

![Create a dashboard](./assets/create-dashboard.png)

3. Select **Add Query**.

![Add Query](./assets/add-query.png)

4. Select Prometheus data source from the **Queries to** drop-down list and choose the `cpu_temperature_celsius` metric.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Select Prometheus data source from the **Queries to** drop-down list and choose the `cpu_temperature_celsius` metric.
4. Choose Prometheus data source from the **Queries to** drop-down list and pick the `cpu_temperature_celsius` metric.

Copy link
Author

@kazydek kazydek Aug 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left "select" but I changed "choose" into "pick".


![New dashboard](./assets/new-dashboard.png)

5. Select the **Instant** query to be able to retrieve the last value for each time series.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Select the **Instant** query to be able to retrieve the last value for each time series.
5. Toggle the **Instant** query to be able to retrieve the last value for each time series.

Just a suggestion to avoid Select. However, I don't understand the last part: "to be able to retrieve the last value for each time series."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, that's not too clear :) I will update it. The idea is that this option allows you to retrieve the "instant" data from the metric.


![Instant option](./assets/instant.png)

6. Switch to the **Visualization** section and select the **Gauge** dashboard type.

![Gauge dashboard type](./assets/gauge-dashboard-type.png)

7. Save the changes by clicking the disk icon in the top right corner of the page. Provide a name for the dashboard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
7. Save the changes by clicking the disk icon in the top right corner of the page. Provide a name for the dashboard.
7. Click the disk icon in the top right corner of the page to save the changes. Provide a name for the dashboard.


![Save the dashboard](./assets/save-dashboard.png)

### Configure the dashboard

To edit the dashboard settings, click the **Panel Title** and select **Edit**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To edit the dashboard settings, click the **Panel Title** and select **Edit**.
To edit the dashboard settings, click the **Panel Title** button and select **Edit**.

or

Suggested change
To edit the dashboard settings, click the **Panel Title** and select **Edit**.
To edit the dashboard settings, go to the **Panel Title** options and select **Edit**.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I choose the second option :)


![Edit the dashboard](./assets/edit-dashboard.png)

1. Back in the **Visualization** section, set up the measuring unit to Celsius degrees to reflect the metric data type.

![Temperature](./assets/temperature-celsius.png)

2. Set the minimum metric value to `60` and the maximum value to `90` to reflect the `cpu_temperature_celsius` metric value range. Enable the **Show labels** option to display this range on the dashboard.

![Minimum and maximum values](./assets/min-max-values.png)

3. Set a red color threshold to `75` for the dashboard to turn red once the CPU temperature reaches and exceeds this value.

![Threshold](./assets/threshold.png)

4. Go to the **General** section and give a title to the dashboard.

![Panel title](./assets/panel-title.png)

5. Save the changes by clicking the disk icon in the top right corner of the page. Add an optional note to describe the changes made.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Save the changes by clicking the disk icon in the top right corner of the page. Add an optional note to describe the changes made.
5. Click the disk icon in the top right corner of the page to save the changes. Add an optional note to describe the changes made.


![Note](./assets/save-note.png)

### Test the dashboard

Refresh the browser to see how the dashboard changes according to the current value of the `cpu_temperature_celsius` metric.

- It turns green if the current metric value ranges from `60` to `74` Celsius degrees:

![Green dashboard](./assets/green-dashboard.png)

- It turns green if the current metric value ranges from `75` to `90` Celsius degrees:

![Red dashboard](./assets/red-dashboard.png)
Binary file added docs/monitoring/assets/add-query.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/create-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/edit-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/gauge-dashboard-type.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/green-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/instant.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/min-max-values.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/new-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/panel-title.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/red-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/save-dashboard.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/save-note.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/stats-and-metrics.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/temperature-celsius.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/monitoring/assets/threshold.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.