Home > Back-end >  Prometheus is not scraping metrics from actuator/prometheus
Prometheus is not scraping metrics from actuator/prometheus

Time:05-22

My actuator-prometheus metrics are reachable under: localhost:5550/linksky/actuator/prometheus For example, I am seeing metric named "http_server_requests_seconds_count"

I have set up my prometheus with docker-compose.yml:

services:
  prometheus:
    image: prom/prometheus
    ports:
      - 9090:9090
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
    networks:
      monitoring:
        aliases:
          - prometheus
networks:
  monitoring:

and my prometheus.yml

scrape_configs:
  - job_name: 'linksky_monitoring'
    scrape_interval: 2s
    metrics_path: '/actuator/prometheus'
    static_configs:
      - targets: ['host.docker.internal:5550']

When I am starting prometheus, I can retrieve metric named "scrape_duration_seconds" and I see that the scrape-job is correct:

enter image description here

But, when I am asking for "http_server_requests_seconds_count", I get no result. Do I expect something wrong? Why do I have only this metric in prometheus, although the "linksky_monitoring" job seems to be running? enter image description here

CodePudding user response:

Your metrics_path in the prometheus.yml is wrong because it's missing a part of the endpoint. It should be like below (/linksky/actuator/prometheus)

scrape_configs:
- job_name: 'linksky_monitoring'
scrape_interval: 2s
metrics_path: '/linksky/actuator/prometheus'
static_configs:
  - targets: ['host.docker.internal:5550']

CodePudding user response:

i need to use tls connection on prometheus, this is a another story.

  • Related