skip to Main Content

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?

2

Answers


  1. Use the following configuration:

      - job_name: 'domain-job'
        scheme: https
        static_configs:
        - targets: ['myDomain.dev']
    
    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search