prometheus is telling me that:
"https://some-domain.com/backoffice" is not a valid hostname"
My config file is:
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']
Any ideas?
As Gaurav said in his answer, we can only use the host type (<domain>
) in the targets
array. In order to incorporate the https scheme
and the path /backoffice
, you need to use scheme
and metric_path
properties respectively in the configuration (scheme
defaults to http
and metric_path to /metrics
if not mentioned explicitly).
I see that you have already added the metric_path:'/actuator/prometheus'
which is shared among other targets
. Therefore, you might need to create different scrape job for the one having a different metric_path
and scheme
as shown here:
- job_name: 'spring_micrometer_2'
scrape_interval: 5s
metrics_path: "/backoffice/actuator/prometheus"
scheme: "https"
static_configs:
- targets:<domain>
If you want to have same job name "spring_micrometer" on all the targets, you can make use of relabel_configs
as shown below on the "spring_micrometer_2" job:
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`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With