本文介绍了使用InfluxDB远程读写API在Prometheus中找不到数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

InfluxDB在Ver1.4中发布了Prometheus远程读写API.

然后,我修改了Prometheus的配置yml(我发现influx doc示例中的'*'应该替换为'-')

我相信Prometheus和InfluxDB正在交流:

但是,我找不到在InfluxDB中插入的样本测量值.

我确定我必须错过一些简单的事情....我是否犯了任何愚蠢的错误?谢谢

解决方案

我们发现,所有度量都放入我们选择的INfluxDB数据库中名为"_"的单个度量中(在我们的例子中称为"metrics")字段为"f64"(我认为是float64).普罗米修斯测量名称附有标签:"名称".因此,以我的经验,上述测量的InfluxDB查询可能类似于:

 从"prometheus"中选择"f64"."_"其中"__name__" ="prometheus_target_interval_length_seconds_count" 

InfluxDB announced Prometheus remote write/read api in ver1.4.

https://docs.influxdata.com/influxdb/v1.4/supported_protocols/prometheus/ https://www.influxdata.com/blog/influxdb-now-supports-prometheus-remote-read-write-natively/

I have deployed a new InfluxDB, created a user called "paul" with password 'foo', created a database called "prometheus" and filled with sample data:

Then, I modified the config yml of Prometheus (I found the '*' in influx doc example should be replaced by '-')

I believe Prometheus and InfluxDB are communicating:

However, I cannot find the sample measurement I inserted in InfluxDB.

I am sure I must miss something simple.... Did I do any silly mistakes? Thanks

解决方案

We found that the metrics were all put into a single measurement called '_' within the INfluxDB database that we chose (called "metrics", in our case) with the field being 'f64' (float64, I assume). The Prometheus measurement name was attached as a label: 'name'. So, in my experience, the InfluxDB query for your measurement above might be something like:

select "f64" from "prometheus"."_" where "__name__" = "prometheus_target_interval_length_seconds_count"

这篇关于使用InfluxDB远程读写API在Prometheus中找不到数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 00:26