To get the microprofile metrics in prometheus, updated the prometheus configuration file with new job for the API.
- job_name: 'myapi'
scheme: 'http'
tls_config:
insecure_skip_verify: false
kubernetes_sd_configs:
- role: service
relabel_configs:
- source_labels: [__meta_kubernetes_service_annotation_myapi]
action: keep
regex: true
Followed all the steps as per the below page.
https://dzone.com/articles/prometheus-metrics-for-microprofile-microservices
But facing the below error now.
Get http://<service_name>:9080/metrics: read tcp <IP>:<port>-><IP>:9080: read: connection reset by peer
Could anyone help on fixing this?