External Prometheus

I have prometheus on an external address. ie it is not installed in kubernetes.
How in lens can I point to this external prometheus host?
I’m only given the option to do something like: <namespace>/<service>:<port>

Connecting to external prometheus is not directly supported at this moment. This is on our roadmap, but unfortunately I can’t give any exact date when this is ready.

However, there are two methods that you could try depending on your setup:

  1. Create service with external name (Service | Kubernetes) that is pointing to external prometheus and configure Lens to use that service.
  2. Use intermediate/proxy prometheus to display metrics for Lens. Typically there is prometheus in the cluster that is scraping the metrics and writing those to external prometheus, you could use that prometheus instance to get metrics displayed on Lens.

Hi, I’m facing the same problem。I created a custom service so i can use prometheus inside cluster, but still got nothing show on the ui, any other configs needed? My node exporter scrap config like this:

Are you able to reach prometheus inside the cluster if you for example try curl with service dns?

Microsoft Azure Kubernetes Service - AKS, recently released a managed prometheus and graphana service. It would be great if we could just link to an external prometheus instance in Lens :+1: You mentioned it’s on the roadmap, do you have a link to the roadmap?

Interesting, please can you share a link for the release/docs? I can take a look is it possible to connect that already (with some workaround)

Here are the docs: Enable Azure Monitor managed service for Prometheus (preview) - Azure Monitor | Microsoft Learn

Wasn’t aware of this myself, but looks interesting!

Was just at Re:Invent, talked to the booth about this problem. I attempted external service and an nginx proxy a while back. Neither worked for random reasons and they were neither straight forward nor easy. I’d have to experiment again to even remember the issues.

Still would like to see some built in Lens capability to access remote prometheus without modifying the cluster. I already need vpn for both prometheus and k8s so they are on the same network. Does the prometheus data absolutely have to come from the cluster I’m connected to?

Then lens just asks for a plain old URL as one of the prometheus options.