prom/influxdb-exporter一个用于InfluxDB 0.9.0及以上版本格式指标的exporter。它通过HTTP API收集行协议格式的指标,进行转换后暴露给Prometheus消费。
此exporter支持float、int和boolean字段。标签(Tags)会转换为Prometheus标签(Labels)。
exporter还监听UDP socket(默认端口9122)以及v2 HTTP端点,通过/metrics端点暴露InfluxDB指标,并通过/metrics/exporter端点暴露自身指标。
默认情况下,暴露的指标不带原始时间戳,如下所示:
http_requests_total{method="post",code="200"} 1027 http_requests_total{method="post",code="400"} 3
如果需要为暴露的指标添加原始时间戳,请使用--timestamps标志,指标将如下所示:
http_requests_total{method="post",code="200"} 1027 1395066363000 http_requests_total{method="post",code="400"} 3 1395066363000
查询时,这意味着样本的时间戳是指标提交到exporter的时间,而非Prometheus抓取的时间。但是,如果在exporter抓取间隔内多次提交指标,只会保留最后一个值和时间戳。
如果以Graphite或Collectd格式向InfluxDB发送数据,请分别使用graphite_exporter和collectd_exporter。
此exporter适用于从现有collectd设置导出指标,以及核心Prometheus exporter(如Node Exporter)未覆盖的指标。
exporter的作用类似于InfluxDB服务器,它不会连接到实际的InfluxDB。有关InfluxDB服务器本身的指标,请使用InfluxDB内置的metrics端点。
如果已在使用Telegraf,其outputs.prometheus_client插件可实现与本exporter相同的功能。
有关Prometheus和InfluxDB生态系统集成的更多信息,请参见influxdata集成页面。
influxdb_exporter可作为普通的InfluxDB服务器使用。例如,要与Telegraf配合使用,在telegraf.conf中添加以下配置:
[[outputs.influxdb]] urls = ["http://localhost:9122"]
如果希望使用UDP:
[[outputs.influxdb]] urls = ["udp://localhost:9122"]
注意,Telegraf已支持通过outputs.prometheus_client直接通过HTTP输出Prometheus指标,无需额外运行influxdb_exporter。
InfluxDB V2支持目前正在开发中。已支持的功能包括:

manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务