You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: grafana/README.md
+50-17Lines changed: 50 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,63 @@
2
2
3
3
## Overview
4
4
5
-
This repository maintains the Grafana dashboards for GreptimeDB. It has two types of dashboards:
5
+
This repository contains Grafana dashboards for visualizing metrics and logs of GreptimeDB instances running in either cluster or standalone mode. **The Grafana version should be greater than 9.0**.
6
6
7
-
-`cluster/dashboard.json`: The Grafana dashboard for the GreptimeDB cluster. Read the [dashboard.md](./dashboards/cluster/dashboard.md) for more details.
8
-
-`standalone/dashboard.json`: The Grafana dashboard for the standalone GreptimeDB instance. **It's generated from the `cluster/dashboard.json` by removing the instance filter through the `make dashboards` command**. Read the [dashboard.md](./dashboards/standalone/dashboard.md) for more details.
7
+
We highly recommend using the self-monitoring feature provided by [GreptimeDB Operator](https://github.com/GrepTimeTeam/greptimedb-operator) to automatically collect metrics and logs from your GreptimeDB instances and store them in a dedicated GreptimeDB instance.
9
8
10
-
As the rapid development of GreptimeDB, the metrics may be changed, and please feel free to submit your feedback and/or contribution to this dashboard 🤗
9
+
-**Metrics Dashboards**
11
10
12
-
**NOTE**:
11
+
-`dashboards/metrics/cluster/dashboard.json`: The Grafana dashboard for the GreptimeDB cluster. Read the [dashboard.md](./dashboards/metrics/cluster/dashboard.md) for more details.
12
+
13
+
-`dashboards/metrics/standalone/dashboard.json`: The Grafana dashboard for the standalone GreptimeDB instance. **It's generated from the `cluster/dashboard.json` by removing the instance filter through the `make dashboards` command**. Read the [dashboard.md](./dashboards/metrics/standalone/dashboard.md) for more details.
13
14
14
-
-The Grafana version should be greater than 9.0.
15
+
-**Logs Dashboard**
15
16
16
-
- If you want to modify the dashboards, you only need to modify the `cluster/dashboard.json` and run the `make dashboards` command to generate the `standalone/dashboard.json` and other related files.
17
+
The `dashboards/logs/dashboard.json` provides a comprehensive Grafana dashboard for visualizing GreptimeDB logs. To utilize this dashboard effectively, you need to collect logs in JSON format from your GreptimeDB instances and store them in a dedicated GreptimeDB instance.
17
18
18
-
To maintain the dashboards easily, we use the [`dac`](https://github.com/zyy17/dac) tool to generate the intermediate dashboards and markdown documents:
19
+
For proper integration, the logs table must adhere to the following schema design with the table name `_gt_logs`:
19
20
20
-
-`cluster/dashboard.yaml`: The intermediate dashboard for the GreptimeDB cluster.
21
-
-`standalone/dashboard.yaml`: The intermediate dashboard for the standalone GreptimeDB instance.
21
+
```sql
22
+
CREATETABLEIF NOT EXISTS `_gt_logs` (
23
+
`pod_ip` STRING NULL,
24
+
`namespace` STRING NULL,
25
+
`cluster` STRING NULL,
26
+
`file` STRING NULL,
27
+
`module_path` STRING NULL,
28
+
`level` STRING NULL,
29
+
`target` STRING NULL,
30
+
`role` STRING NULL,
31
+
`pod` STRING NULL SKIPPING INDEX WITH(granularity ='10240', type ='BLOOM'),
As GreptimeDB evolves rapidly, metrics may change over time. We welcome your feedback and contributions to improve these dashboards 🤗
47
+
48
+
To modify the metrics dashboards, simply edit the `dashboards/metrics/cluster/dashboard.json` file and run the `make dashboards` command. This will automatically generate the updated `dashboards/metrics/standalone/dashboard.json` and other related files.
49
+
50
+
For easier dashboard maintenance, we utilize the [`dac`](https://github.com/zyy17/dac) tool to generate human-readable intermediate dashboards and documentation:
51
+
52
+
-`dashboards/metrics/cluster/dashboard.yaml`: The intermediate dashboard file for the GreptimeDB cluster.
53
+
-`dashboards/metrics/standalone/dashboard.yaml`: The intermediate dashboard file for standalone GreptimeDB instances.
22
54
23
55
## Data Sources
24
56
25
-
There are two data sources for the dashboards to fetch the metrics:
57
+
The following data sources are used to fetch metrics and logs:
26
58
27
-
-**Prometheus**: Expose the metrics of GreptimeDB.
28
-
-**Information Schema**: It is the MySQL port of the current monitored instance. The `overview` dashboard will use this datasource to show the information schema of the current instance.
59
+
-**`${metrics}`**: Prometheus data source for providing the GreptimeDB metrics.
60
+
-**`${logs}`**: MySQL data source for providing the GreptimeDB logs.
61
+
-**`${information_schema}`**: MySQL data source for providing the information schema of the current instance and used for the `overview` panel. It is the MySQL port of the current monitored instance.
29
62
30
63
## Instance Filters
31
64
@@ -43,9 +76,9 @@ And the legend will be like: `[{{instance}}]-[{{ pod }}]`.
43
76
44
77
## Deployment
45
78
46
-
### Helm
79
+
### (Recommended) Helm Chart
47
80
48
-
If you use the Helm [chart](https://github.com/GreptimeTeam/helm-charts) to deploy a GreptimeDB cluster, you can enable self-monitoring by setting the following values in your Helm chart:
81
+
If you use the [Helm Chart](https://github.com/GreptimeTeam/helm-charts) to deploy a GreptimeDB cluster, you can enable self-monitoring by setting the following values in your Helm chart:
49
82
50
83
-`monitoring.enabled=true`: Deploys a standalone GreptimeDB instance dedicated to monitoring the cluster;
51
84
-`grafana.enabled=true`: Deploys Grafana and automatically imports the monitoring dashboard;
@@ -85,5 +118,5 @@ The standalone GreptimeDB instance will collect metrics from your cluster, and t
85
118
86
119
3. **Import the dashboards based on your deployment scenario**
87
120
88
-
- **Cluster**: Import the `cluster/dashboard.json` dashboard.
89
-
- **Standalone**: Import the `standalone/dashboard.json` dashboard.
121
+
- **Cluster**: Import the `dashboards/metrics/cluster/dashboard.json` dashboard.
122
+
- **Standalone**: Import the `dashboards/metrics/standalone/dashboard.json` dashboard.
0 commit comments