Facing read: connection reset by peer error

45 views
Skip to first unread message

Radhika Thomas

unread,
Feb 3, 2020, 6:32:09 AM2/3/20
to Prometheus Users
Hi, 

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?

李国忠

unread,
Feb 4, 2020, 10:29:53 AM2/4/20
to Prometheus Users

Check whether the path configuration is the default "/ metrics". If not, you need to specify it manually. Metrics_path: 'your path'

在 2020年2月3日星期一 UTC+8下午7:32:09,Radhika Thomas写道:

Radhika Thomas

unread,
Feb 18, 2020, 11:15:28 PM2/18/20
to Prometheus Users
Hi,

By default, the path was being referred to /metrics as expected. I have updated the job with Metrics_path: '/metrics' in the configuration as well..Still, I am facing the issue.
Do you have any other thoughts?

Brian Candler

unread,
Feb 19, 2020, 3:33:47 AM2/19/20
to Prometheus Users
Is it http or https?  What do the following commands show?

curl -v http://<service_name>:9080/metrics
curl -vk https://<service_name>:9080/metrics

If it's https then you'll need "scheme: https".  If it's http then you don't need "tls_config".
Reply all
Reply to author
Forward
0 new messages