1.job:metrics_path
如果是靜態模式下配置job(statics),直接配置job的metrics_path選項是不生效的。需要同時在exporter端指定metrics_path。如圖
prometheus server端配置:
exporter端啟動命令(假設是node-exporter):
/node_exporter --web.telemetry-path=/danny
這里的“--web.telemetry-path=/danny”就是指定path是"/danny",而非默認的“/metrics”;
2.global:external_labels
配置項external_labels是用於外部系統標簽的,不是用於metrics數據
3.job:honor_labels
honor_labels主要用於解決prometheus server的label與exporter端用戶自定義label沖突的問題。
官方說明:
#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.