首页 > 解决方案 > 关于 Docker-Prometheus mysql exporter 数据库

问题描述

我正在尝试在普罗米修斯上显示来自 mysql 数据库的数据。但我找不到显示我的数据库数据的查询。我使用过 docker,这就是我连接 prometheus 和 mysql exporter 的方式。

-普罗米修斯-

docker run -d --name prometheus -h prometheus -p 9090:9090 -v C:\Docker\prometheus\prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml

-mysql-(*是我的ip和数据库ip)

docker run -d --name mysqld_exporter -p 9104:9104 -e DATA_SOURCE_NAME="***************@(***.***.*.***:****)/prometheus" prom/mysqld-exporter --collect.auto_increment.columns --collect.binlog_size --collect.engine_innodb_status --collect.engine_tokudb_status --collect.global_status --collect.global_variables --collect.info_schema.tables

-prometheus.yml-

- job_name : 'mysql'
static_configs:
- targets: ['***.**.***.*:9104']
- job_name : 'prometheus'
static_configs:
- targets: ['***.**.***.*:9104']

-数据库-

名称:普罗米修斯

表:covid_19

列:数量,温度

在此处输入图像描述

所以关键是我想每 15 秒通过普罗米修斯显示温度,但我不知道我应该怎么做。

谢谢。

标签: mysqldockerprometheus

解决方案


推荐阅读