prometheus 配置项注意事项

1.job:metrics_pathnode

若是是静态模式下配置job(statics),直接配置job的metrics_path选项是不生效的。须要同时在exporter端指定metrics_path。如图web

prometheus server端配置:ide

 

exporter端启动命令(假设是node-exporter):spa

/node_exporter --web.telemetry-path=/dannycode

这里的“--web.telemetry-path=/danny”就是指定path是"/danny",而非默认的“/metrics”;server

 

2.global:external_labelsblog

配置项external_labels是用于外部系统标签的,不是用于metrics数据ci

 

3.job:honor_labelsget

honor_labels主要用于解决prometheus server的label与exporter端用户自定义label冲突的问题。io

官方说明:

#If honor_labels is set to "true", label conflicts are resolved by keeping label
# values from the scraped data and ignoring the conflicting server-side labels.
#
# If honor_labels is set to "false", label conflicts are resolved by renaming # conflicting labels in the scraped data to "exported_<original-label>" (for
# example "exported_instance", "exported_job") and then attaching server-side
# labels. This is useful for use cases such as federation, where all labels
# specified in the target should be preserved.
相关文章
相关标签/搜索