-
Notifications
You must be signed in to change notification settings - Fork 34
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
Grafana dashboard setup manual #430
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4aa4e0b
Create grafana-dashboard.md
RomanLabGit 1a538db
Create 1.tmp
RomanLabGit c40af58
Create 1.txt
RomanLabGit ac59b81
Add files via upload
RomanLabGit 4f4a61c
Update grafana-dashboard.md
RomanLabGit ce42246
Update grafana-dashboard.md
RomanLabGit 5b45881
Delete static/img/doc-imgs/additional-guides/1.tmp
RomanLabGit 2c0d4a0
Delete static/img/doc-imgs/additional-guides/1.txt
RomanLabGit 368b62e
Update grafana-dashboard.md
RomanLabGit 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
78 changes: 78 additions & 0 deletions
78
docs/farming-&-staking/farming/additional-guides/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,78 @@ | ||
--- | ||
title: Grafana Dashboard | ||
sidebar_position: 2 | ||
description: How to configure the Grafana dashboard for a Subspace Network node | ||
keywords: | ||
- node | ||
- farmer | ||
- monitoring | ||
- grafana | ||
- prometheus | ||
--- | ||
|
||
# Grafana Dashboard | ||
|
||
## Prerequisites | ||
|
||
First install [Grafana](https://grafana.com/) and [Prometheus](https://prometheus.io/) on your machine. | ||
|
||
:::note | ||
You can also use [Grafana Cloud](https://grafana.com/products/cloud/) instead of installing it locally. | ||
::: | ||
|
||
## Enable metrics | ||
|
||
To enable metrics, you'll have to modify the CLI arguments of your node and farmer by adding the Prometheus option: | ||
|
||
for a node: | ||
`--prometheus-listen-on 127.0.0.1:9080` | ||
|
||
for a farmer: | ||
`--metrics-endpoints 127.0.0.1:9081` | ||
|
||
To apply the changes, it's necessary to restart your node and farmer. You should then have the capability to reach the metrics at `http://localhost:9080` and `http://localhost:9081`. | ||
|
||
## Configure Prometheus targets | ||
|
||
Locate the `prometheus.yml` file and add the following job entry under the `scrape_configs` section: | ||
``` | ||
- job_name: "subspace" | ||
static_configs: | ||
- targets: ["localhost:9080"] | ||
labels: | ||
group: 'node' | ||
- targets: ["localhost:9081"] | ||
labels: | ||
group: 'farmer' | ||
``` | ||
On Linux machines, you can typically find the `prometheus.yml` file at the following path: `/etc/prometheus/prometheus.yml` | ||
|
||
Restart Prometheus with the new configuration. | ||
|
||
:::note | ||
Prometheus can reload its configuration without restarting by using the SIGHUP signal. If you're running on Linux this can be performed by using `kill -s SIGHUP <PID>`, replacing <PID> with your Prometheus process ID. | ||
::: | ||
|
||
## Configure Grafana | ||
|
||
By default, Grafana usually runs on port 3000. You can access Grafana by navigating to the following URL: `http://localhost:3000`. | ||
|
||
The default username and password is `admin`. | ||
|
||
Add your Prometheus Data Source: | ||
|
||
![grafana-config.png](/img/doc-imgs/additional-guides/grafana-config.png) | ||
|
||
Click `Save & test` to test the configuration, if everything is alright you'll see the green message "Data source is working". | ||
|
||
## Import Grafana dashboard | ||
|
||
Copy and paste the [Grafana Dashboard ID](https://grafana.com/grafana/dashboards/20433) `20433` and click `Load` to complete importing: | ||
|
||
![grafana-import.png](/img/doc-imgs/additional-guides/grafana-import.png) | ||
|
||
Select your `Prometheus` as Data Source and click `Import`. | ||
|
||
At this point, you should be able to monitor your node. | ||
|
||
![grafana-dashboard.png](/img/doc-imgs/additional-guides/grafana-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.
Oops, something went wrong.
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.
This is breaking a preview, let's please fix it and have another glance how it looks on a preview deployment.
I did build it locally and it seemed fine 👍
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.
fixed