Prometheus:使用https方案的主机名无效
普罗米修斯告诉我: “”不是有效的主机名 我的配置文件是:Prometheus:使用https方案的主机名无效,prometheus,Prometheus,普罗米修斯告诉我: “”不是有效的主机名 我的配置文件是: global: scrape_interval: 10s scrape_configs: - job_name: 'spring_micrometer' metrics_path: '/actuator/prometheus' scrape_interval: 5s static_configs: - targets: ['192.168.99.102:8085', '192.1
global:
scrape_interval: 10s
scrape_configs:
- job_name: 'spring_micrometer'
metrics_path: '/actuator/prometheus'
scrape_interval: 5s
static_configs:
- targets: ['192.168.99.102:8085', '192.168.99.102:8083', '192.168.99.102:8084', 'https://<domain>/backoffice']
全球:
刮除间隔:10秒
刮取_配置:
-工作名称:“弹簧测微计”
度量路径:'/actuator/prometheus'
刮除间隔:5s
静态\u配置:
-目标:['192.168.99.102:8085','192.168.99.102:8083','192.168.99.102:8084','https:///backoffice']
有什么想法吗?静态配置目标需要是由主机名或IP后跟可选端口号组成的有效字符串 这里的有效主机名应该是
而不是https:///backoffice
作为参考,您可以在下面查看
要检查主机名是否有效,请检查以下正则表达式测试
正如Gaurav在他的文章中所说,我们只能在目标
数组中使用类型(
)。为了合并https方案
和路径/backoffice
,您需要在配置中分别使用方案
和度量路径
属性(scheme
默认为http
,如果未明确提及,则公制路径为/metrics
)
我看到您已经添加了度量路径:'/actuator/prometheus'
,该路径在其他目标中共享。因此,您可能需要为具有不同度量路径和方案的目标创建不同的刮取作业,如下所示:
- job_name: 'spring_micrometer_2'
scrape_interval: 5s
metrics_path: "/backoffice/actuator/prometheus"
scheme: "https"
static_configs:
- targets:<domain>
scrape_configs:
- job_name: 'spring_micrometer'
metrics_path: '/actuator/prometheus'
scrape_interval: 5s
static_configs:
- targets: ['192.168.99.102:8085', '192.168.99.102:8083', '192.168.99.102:8084']
- job_name: 'spring_micrometer_2'
scrape_interval: 5s
metrics_path: "/backoffice/actuator/prometheus"
scheme: "https"
static_configs:
- targets:<domain>
relabel_configs:
- source_labels: [job]
target_label: job
replacement: `spring_micrometer`