Unable to fetch metrics from Application using telegraf

We have a GO application with installed Prometheus client and Telegraf container with Prometheus input plugin trying to fetch default metrics. Instrumented app using promehteus guide for instrumenting go app,
However when starting telegraf container, it is unable to fetch metrics from the endpoint. My application is exposed as service and telegraf conf are attached. Please let me know what I’m missing here.

[[inputs.prometheus]]
urls = [“https://sample-service.test.svc.cluster.local:2112/metrics”]

Tried using kubernetes_services as well, which are not working

[[outputs.file]]
files = [“stdout”]
data_format = “json”

Service.yaml

apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/port: “2112”
prometheus.io/scrape: “true”
name: sample-service
namespace: test
spec:
ports:
- name: https
port: 2112
targetPort: 2112

Error I’m facing is.

2019-12-02T10:13:30Z E! [inputs.prometheus]: Error in plugin: error making HTTP request to https://127.0.0.1:2112/metrics:

dial tcp 127.0.0.1:2112: connect: connection refused

Hi @pavan_kumar, would you exec into the telegraf container and try to curl https://127.0.0.1:2112/metrics ?