Prometheus not picking up custom kubernetes service metric target

15 views
Skip to first unread message

Shubham Jain

unread,
Jun 19, 2020, 8:16:21 AM6/19/20
to Prometheus Users

Added section for custom metrics target on top of default prometheus file from helm stable/prometheus



...DEFAULT



   
- job_name: my_app_metrics

      scrape_interval
: 5m

      scrape_timeout
: 10s

      honor_labels
: true

      metrics_path
: /api/metrics

      kubernetes_sd_configs
:

     
- role: service

        selectors
:

         
- role:  "service"

            label
: "name=myapp"

...DEFAULT



To target my service configured as


apiVersion: v1



kind
: Service

metadata
:

  name
: myapp

 
namespace: production

spec
:

  selector
:

    name
: myapp

    deployment
: production

  type
: ClusterIP

  ports
:

   
- port: 80

      targetPort
: 5000

      protocol
: TCP


I have restarted the prometheus pod, by deleting the existing one still my custom metric is not listed in /targets of prometheus

Prometheus version: 11.3.0

Reply all
Reply to author
Forward
0 new messages