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: TCPI 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