Привет!
В этой статье поговорим о том, как бороться с несекьюрным SSL сертификатом для плагинов Prometheus for Jira, Prometheus for Confluence , Prometheus for Bitbucket и Prometheus for Bamboo.
Предположим, Вы подключаетесь к экземпляру Jira, Confluence, Bitbucket или Bamboo, у которого несекьюрный SSL сертификат, вот с таким конфигом:
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# A scrape configuration containing exactly one endpoint to scrape:
scrape_configs:
- job_name: 'jira'
scheme: https #change to http if don't you have https
metrics_path: '/plugins/servlet/prometheus/metrics'
static_configs:
- targets: ['yourinstance.com']
В этом случае, если Вы зайдете в меню System → Targets в Prometheus, то Вы увидите вот такой скрин с ошибкой:

А вот ошибка:
x509: certificate has expired or is not yet valid
Нам нужно как-то сказать Prometheus не проверять SSL сертификат, и мы можем это сделать вот такими параметрами в конфиг файле:
tls_config:
insecure_skip_verify: true
А вот и финальный конфиг:
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# A scrape configuration containing exactly one endpoint to scrape:
scrape_configs:
- job_name: 'bitbucket'
scheme: https #change to http if don't you have https
metrics_path: '/plugins/servlet/prometheus/metrics'
static_configs:
- targets: ['yourinstance.com']
tls_config:
insecure_skip_verify: true
Теперь наш джоб запущен и вытаскивает метрики.