I run prometheus with docker , but I facing an issue in promethuse targets
x509: certificate is not valid for any names, but wanted to match prometheus
- docker-compose.yml
prometheus:
image: prom/prometheus
volumes:
- ./conf_prometheus:/etc/prometheus
- ./prometheus_data:/prometheus
- ./cer/promethuse_cert/:/etc/ssl/certs
- ./conf_prometheus/web-config/prom/:/etc/prometheus/web-config
command:
- '--web.config.file=/etc/prometheus/web-config/web-config.yml'
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- 9090:9090
- prometheus.yml
scrape_configs:
- job_name: 'prometheus'
metrics_path: /metrics
scheme: https
scrape_interval: 15s
static_configs:
- targets: ['prometheus:9090']
tls_config:
cert_file: /etc/ssl/certs/promethuse.crt
key_file: /etc/ssl/certs/promethuse.key
I found this in the logs
msg="remote error: tls: bad certificate"