26

I want to add my HTTPS target URL to Prometheus, an error like this appears:

"https://myDomain.dev" is not a valid hostname"

my domain can access and run using proxy pass Nginx with port 9100(basically I made a domain for node-exporter)

my configuration prometheus.yml

scrape_configs:
  - job_name: 'prometheus'

    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'domain-job'
    static_configs:
    - targets: ['https://myDomain.dev']

is there any more configuration to add?

Inadrawiba
  • 599
  • 1
  • 6
  • 13

2 Answers2

46

Use the following configuration:

  - job_name: 'domain-job'
    scheme: https
    static_configs:
    - targets: ['myDomain.dev']
7

Besides configuring the https scheme, if you need to skip the tls or need to configure a bearer token, this config will work:

job_name: 'spring-actuator'
  scheme: https
  authorization:
      type: Bearer
      credentials: <your_token>
  tls_config:
      insecure_skip_verify: true
  metrics_path: '/actuator/prometheus'
  scrape_interval: 5s
  static_configs:
    - targets: ['your_ip:your_port']

If you need other configuration, this reference might help you.

jumping_monkey
  • 5,941
  • 2
  • 43
  • 58