Skip to content

Commit

Permalink
[doc]Grafana doc (#2636)
Browse files Browse the repository at this point in the history
Co-authored-by: shown <[email protected]>
  • Loading branch information
zqr10159 and yuluo-yx authored Aug 30, 2024
1 parent d49cb37 commit 59398bd
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
41 changes: 41 additions & 0 deletions home/docs/help/grafana_dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: grafana_dashboard
title: Grafana Dashboard
sidebar_label: Grafana Historical Charts
keywords: [Grafana, Historical Dashboard]
---

> `Grafana` is an open source visualization and analytics platform that helps you easily create, share and monitor dashboards. In this article, we will cover how to use `Grafana` to display historical data in `HertzBeat`.
### Prerequisites

- The `Grafana` service is started and the account password is configured.
- The `HertzBeat` service is started and the `VictoriaMetrics` timeseries database is configured (note: the `VictoriaMetrics` data source is required).

:::caution Caution.
`Grafana` can only show historical data for `Prometheus` type of monitoring, currently it does not support monitoring data defined by `yml` in `HertzBeat`.
:::

### Configuring Grafana in HertzBeat

In the configuration file `hertzbeat.yml` in `HertzBeat`, configure the `Grafana` data source.

```yaml
grafana:
enabled: true
url: http://127.0.0.1:3000
username: admin
password: admin
```
### Upload Grafana monitor template json file in HertzBeat monitor
In `HertzBeat`, when creating or editing a `Prometheus` type monitor, click Enable Grafana Templates and select the Grafana template json file to upload.
The monitor template json file can be downloaded at <https://grafana.com/grafana/dashboards/>.
For example, create a new monitor in `HertzBeat` for `VictoriaMetrics` single node, then open <https://grafana.com/grafana/dashboards/10229-victoriametrics-single-node/>, click `Download JSON` button on the right side. `Download JSON` button on the right to download the template json file. Upload the template json file in the `HertzBeat` monitor, save it.
![grafana-1.png](/img/docs/help/grafana-1.png)

### View Grafana historical charts

On the `HertzBeat` monitoring page, click the `Grafana` button, select `Grafana` Historical Charts, select a monitoring template, and click the `Query` button to view the `Grafana` historical charts.
![grafana-2.png](/img/docs/help/grafana-2.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
id: grafana_dashboard
title: Grafana Dashboard
sidebar_label: Grafana历史图表
keywords: [Grafana, 历史图表]
---

> `Grafana`是一个开源的可视化和分析平台,它可以帮助你轻松地创建、分享和监控仪表板。本文将介绍如何在`HertzBeat`中使用`Grafana`展示历史数据。
### 前提条件

- `Grafana`服务已经启动,并配置好了账号密码。
- `HertzBeat`服务已经启动,并配置好了`VictoriaMetrics`时序数据库(注意: `VictoriaMetrics`数据源是必须的)。

:::caution 注意
`Grafana`只能展示`Prometheus`类型监控的历史数据,目前并不支持`HertzBeat``yml`定义的监控数据。
:::

### 在HertzBeat中配置Grafana

`HertzBeat`的配置文件`hertzbeat.yml`中,配置`Grafana`数据源:

```yaml
grafana:
enabled: true
url: http://127.0.0.1:3000
username: admin
password: admin
```
### 在HertzBeat监控中上传Grafana监控模板json文件
`HertzBeat`新建或编辑`Prometheus`类型监控时,点击启用Grafana模板,选择Grafana模板json文件上传。
监控模板json文件可以在 <https://grafana.com/grafana/dashboards/> 下载。
比如,在`HertzBeat`中新建一个关于`VictoriaMetrics`单节点的监控,然后打开 <https://grafana.com/grafana/dashboards/10229-victoriametrics-single-node/> ,点击右侧 `Download JSON`按钮,下载模板json文件。在`HertzBeat`监控中上传模板json文件,保存。
![grafana-1.png](/img/docs/help/grafana-1.png)

### 查看Grafana历史图表

在`HertzBeat`监控页面,点击`Grafana`按钮,选择`Grafana`历史图表,选择监控模板,点击`查询`按钮,即可查看`Grafana`历史图表。
![grafana-2.png](/img/docs/help/grafana-2.png)
1 change: 1 addition & 0 deletions home/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
"help/bulletin",
"help/plugin",
"help/time_expression",
"help/grafana_dashboard",
"help/issue"
]
},
Expand Down
Binary file added home/static/img/docs/help/grafana-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added home/static/img/docs/help/grafana-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59398bd

Please sign in to comment.