Rancher Monitoring v2.4 - Prometheus external applications

Hi All,

So in Rancher we can install Grafana and Prometheus to monitor the cluster which is great.
Can I use Prometheus to get stats from Applications outside of the K8s cluster ?

I don’t want to install/maintain a separate instance of Prometheus/Grafana and waist resources.
I can expose these UIs via an ingress

Is there a way to add the scrape_configs via UI in Prometheus? If not how do I change the config yaml file to add an external service to monitor?
Will a helm upgrade of the Cluster Monitoring break my changes?
How does the access/permissions work If I do this ?
Sorry for all the questions.

Thanks for any help

1 Like

I know it’s an old question, but here is my solution:
We crated a new Ingress with these config

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    field.cattle.io/description: Fun with prometehus
  name: lucarelli-prometheus
  namespace: cattle-monitoring-system
spec:
  ingressClassName: nginx
  rules:
  - host: lucarelli-prometheus.paas.dasbaum.ch
    http:
      paths:
      - backend:
          service:
            name: rancher-monitoring-prometheus
            port:
              number: 9090
        path: /
        pathType: Prefix

Now we could add this Prometheus as our external data source:
HTTP URL: https://lucarelli-prometheus.paas.dasbaum.ch/
HTTP Method: GET

Hope I could help someone with it.

When I used the yaml you gived, when get into the https://lucarelli-prometheus.paas.dasbaum.ch/,it shows :
503 Service Unavailable
No server is available to handle this request.

the URL isn’t public available :slight_smile: it’s only an example