x509: certificate signed by unknown authority for prometheus

Viewed 5447

I was trying to monitor one of our Spring boot application using Prometheus but unfortunately the status of this service is not getting UP in ubuntu server, it’s showing some error like –

/prometheus: x509: certificate signed by unknown authority, Where from my local Prometheus this service is UP and also able to monitor some of the http requests. error snapshot

2 Answers

I have faced the same issue. Solved it by:

Configure Prometheus to ignore ssl verification as suggested by @Shmuel

global:
  scrape_interval:     15s
  external_labels:
    monitor: 'prometheus'

scrape_configs:
  - job_name: 'job-name'

    static_configs:
      - targets:
        - host_name_or_ip_address1
        - host_name_or_ip_address2
        - host_name_or_ip_address2

    scheme: https  # to use https instead of http for scraping

    tls_config:
      insecure_skip_verify: true  # This is the key

If you are using a self-signed certificate you can add the certificate to the scrape_configs under tls_config:

global:
  scrape_interval:     15s
  external_labels:
    monitor: 'prometheus'

scrape_configs:
  - job_name: 'job-name'

    static_configs:
      - targets:
        - host_name_or_ip_address1

    tls_config:
      ca_file: /path/to/prometheus.crt

    scheme: https
Related