JimWen / nebula-stats-exporter

Data exporter of Nebula Graph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

非 k8s 环境下部署监控使用文档

编写 config.yaml 文件

config.yaml 中的 nebulaItems 下添加监控的 nebula 组件,instanceName 用于标示组件名称,endpointIP 用于指定该组件的 IP 地址,endpointPort 用于指定该组件的 http 端口,nebulaType用于指定该组件的服务类型: metadstoraged 或者 graphd。 例子如下:

nebulaItems:
  - instanceName: metad-0
    endpointIP: 127.0.0.1 # nebula host IP
    endpointPort: 12000
    nebulaType: metad

运行 nebula-stats-exporter

直接运行:

docker run -d --restart=always -p 9100:9100 -v {directory to config.yaml}:/config \
 vesoft/nebula-stats-exporter:v0.0.1  --bare-metal --bare-metal-config-path=/config/config.yaml

配置 prometheus

prometheus.yaml 中配置好 nebula-stats-exporter,这里需要使用静态配置,并在 static_configs 中指定 nebula-stats-exporter 的 metrics endpoints。

如下面的例子:

global:
  scrape_interval:     5s
  evaluation_interval: 5s
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
  - job_name: 'nebula-stats-exporter'
    static_configs:
      - targets: ['192.168.0.103:9100'] # nebula-stats-exporter metrics endpoints # nebula host IP

然后运行 prometheus:

docker run -d --name=prometheus --restart=always \
-p 9090:9090 -v {directory to prometheus config}:/etc/prometheus/ prom/prometheus

配置 grafana

先启动 grafana:

docker run -d -p 3000:3000 grafana/grafana

然后将 grafana.json 导入到 nebula 的 dashboard中。

About

Data exporter of Nebula Graph


Languages

Language:Go 95.5%Language:Makefile 3.4%Language:Dockerfile 0.8%Language:Shell 0.3%