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
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d93c18f
Add a tutorial on creating a simple Grafana dashboard
6a8c049
Remove additional space
33db490
Add a minor fix
8d4462d
Add a fix
890f2d6
Add post-review fixes
aa978da
Fix governance issues
23b2849
Change the domain address
c0b6b38
Add a minor fix
febd67f
Add minor changes
93c9db8
Add even more fixes
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
docs/monitoring/08-02-create-and-configure-grafana-dashboard.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
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/`. 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 pick the `cpu_temperature_celsius` metric. | ||
|
||
![New dashboard](./assets/new-dashboard.png) | ||
|
||
5. Toggle the **Instant** query to be able to retrieve the latest metric value on demand. | ||
|
||
![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. 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, go to the **Panel Title** options and select **Edit**. | ||
|
||
![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. 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) | ||
|
||
### Verify 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) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we should mention nightly cluster in examples as it is not available for everyone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I will change it into
https://grafana.example.com/
.