promlens
promlens copied to clipboard
Prometheus with Basic Auth
Currently Promlens does not support if Prometheus is protected via basic auth, would be great if that could be added.
+1. Would love to see either Basic Auth working with PromLens or PromLens incorporated into the Prometheus Web UI as an additional option.
Hey, same issue here!
I am hosting PromLens on Kubernetes and I used a workaround this way:
- Promlens is hosted in same namespace than Prometheus
- I declared two ingress ressources:
- One to Promlens service
- Another one, on same hostname, which is a proxy to prometheus service. This way, prometheus api is served on same hostname and on prefix: /prometheus
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/auth-url: http://nginx-ldap-auth.kube-system.svc.cluster.local:5555 # our basic-auth system
name: promlens
namespace: monitoring
spec:
ingressClassName: ingress-private
rules:
- host: promlens.myfqdn
http:
paths:
- backend:
service:
name: promlens
port:
number: 8080
path: /
pathType: Prefix
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/auth-url: http://nginx-ldap-auth.kube-system.svc.cluster.local:5555
nginx.ingress.kubernetes.io/rewrite-target: /$2
name: promlens-to-prometheus
namespace: monitoring
spec:
ingressClassName: ingress-private
rules:
- host: promlens.myfqdn
http:
paths:
- backend:
service:
name: prometheus-prometheus
port:
number: 9090
path: /prometheus(/|$)(.*)
pathType: Prefix
Thanks for this awesome tool! :)
I just found another nice workaround. Just use --grafana.url
. Then Grafana will handle basic auth. PromLens even says this in the logs:
promlens_1 | 2023/01/31 18:27:46 Proxying to Grafana at /api/datasources/proxy/92/api/v1/query...
Cheers :)
I just found another nice workaround. Just use
--grafana.url
. Then Grafana will handle basic auth. PromLens even says this in the logs:promlens_1 | 2023/01/31 18:27:46 Proxying to Grafana at /api/datasources/proxy/92/api/v1/query...
Cheers :)
I have a grafana behind TLS but SSL certificate is not valid. Is there a way to disable it ?
tls_skip_verify_insecure maybe ? but where.
I added support for Basic Auth in this Fork (https://github.com/glidea/promlens), and a 'datasource' manager (https://github.com/glidea/promlens-datasource-manager)