Skip to content

Commit

Permalink
Grafana doc (#2647)
Browse files Browse the repository at this point in the history
Co-authored-by: liutianyou <[email protected]>
  • Loading branch information
zqr10159 and LiuTianyou authored Sep 1, 2024
1 parent 2076693 commit 3e1d87b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
18 changes: 16 additions & 2 deletions home/docs/help/grafana_dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,30 @@ keywords: [Grafana, Historical Dashboard]
### Prerequisites

- The `Grafana` version 8.1.0 or later is installed and running.
- 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).
- The `HertzBeat` service is started and the `VictoriaMetrics` time-series 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`.
:::

### enable Grafana embedded url

ref: <https://grafana.com/blog/2023/10/10/how-to-embed-grafana-dashboards-into-web-applications/>
In the `Grafana` configuration file `grafana.ini`, set the `allow_embedding = true`.
In the `Grafana` configuration file `grafana.ini`, set the `[auth.anonymous]` option to `true`.

```ini
allow_embedding = true
[auth.anonymous]
# enable anonymous access
enabled = true
```

### Configuring Grafana in HertzBeat

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

```yaml
grafana:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,30 @@ keywords: [Grafana, 历史图表]
### 前提条件

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

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

### 启用Grafana 可嵌入功能, 并开启匿名访问

参考: <https://grafana.com/blog/2023/10/10/how-to-embed-grafana-dashboards-into-web-applications/>
修改配置文件`grafana.ini`中的`allow_embedding = true`
修改配置文件`grafana.ini`中的`[auth.anonymous]``true`

```ini
allow_embedding = true
[auth.anonymous]
# enable anonymous access
enabled = true
```

### 在HertzBeat中配置Grafana

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

```yaml
grafana:
Expand Down

0 comments on commit 3e1d87b

Please sign in to comment.