1

I have springboot and non-springboot (Eclipse Microprofile) Rest APIs running in openshift . Both are have service endpoint port 9443

SpringBoot metrics path - /actuator/prometheus Eclipse Microprofile metrics path /metrics

Eclipse Microprofile scrape config

    - job_name: 'microprofile-metric'
      scrape_interval: 1m
      metrics_path: /metrics
      scheme: https
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
      kubernetes_sd_configs:
      - role: endpoints

Springboot scrape config

    - job_name: 'springboot-metric'
      scrape_interval: 1m
      metrics_path: /actuator/prometheus
      scheme: https
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
      kubernetes_sd_configs:
      - role: endpoints

As the MP metrics are not available in springboot apps, seeing WARN of NOT Found endpoint (/metircs) in the application logs and same is the case with microprofile apps - /actuator/prometheus endpoint not found.

How can I can configure proemtheus scraping ?

Thanks Raj

funtoos
  • 295
  • 1
  • 4
  • 17

1 Answers1

0

Stumbled on stackoverflow answers here and here and learned something new, We can set custom path for springboot actuators.

set these up

management.endpoints.web.base-path=/
management.endpoints.web.path-mapping.prometheus=metrics

and viola, issue resolved.

A huge shoutout to Stackovrlfow maintainers, contributors and of course the users, all of you made my day.

funtoos
  • 295
  • 1
  • 4
  • 17