Open KarstenSiemer opened 1 year ago
Hi @KarstenSiemer , have you ever figure out this? I pretty much reproduced what you described running the latest version, Helm chart version 1.6.135. From a pod inside the cluster, I do
curl -v -u monitoring:<PASSWORD> -H 'Host: <HOSTNAME>' <POD_IP>:80/django_metrics
And I get a redirect to https://<HOSTNAME>/django_metrics
, then I tried from outside of the cluster
curl -v -u monitoring:<PASSWORD> https://<HOSTNAME>/django_metrics
And I get a redirect to /login?next=/django_metrics
.
I'd love to have a ServiceMonitor for it, I think it would be a pretty good enhancement for the chart to create it, but first step is to be able to retrieve the metrics.
On another attempt, I tried to use local_settings.py
with the following content because I thought the end /
of django_metrics/
could be the issue
LOGIN_EXEMPT_URLS += (rf'^{URL_PREFIX}django_metrics',)
After that,
curl -v -u monitoring:<PASSWORD> https://<HOSTNAME>/django_metrics
Gives 404 Not Found
. In the logs, I see:
WARNING [django.request:241] Not Found: /django_metrics
Well, that was quite a surprise.
curl -v -u monitoring:<PASSWORD> https://<HOSTNAME>/django_metrics/metrics
Worked! :clown_face:
No modification needed in the setup, just that.
Next step is setup a ServiceMonitor
for it.
Slack us first! I have raised the issue via Slack here but we were unable to fix it.
Be informative / bug description I’d like to improve our monitoring for defectdojo, which is running inside kubernetes, using the helm terraform provider. Through kube-state-metrics we are monitoring for crashloops and so on, but I’d like to get more in-depth infos from the setup.
monitoring.enabled
as well asmonitoring.prometheus.enabled
are set to true Yet, as you can see here, the helm chart did not open a port in the pod. So we cannot use either PodMonitor nor ServiceMonitor of the prometheus-operator to gather the metrics.When internally asking the nginx container, you receive nginx metrics.
(this was run within the cluster against the service from defectdojo)
Because of
X-Frame-Options: DENY
I'd guess that request is denied. Username and Password are correct.Steps to reproduce Steps to reproduce the behavior:
monitoring.enabled
as well asmonitoring.prometheus.enabled
DD_DJANGO_METRICS_ENABLED=true
is set in the environment of the containerExpected behavior Be able to gather monitoring data about the nginx container and the uwsgi container.
Deployment method (select with an
X
)Environment information
git show -s --format="[%ci] %h: %s [%d]"
] 2.23.1Logs
Additional context (optional)
/django_metrics
appears to be inLOGIN_EXEMPT_URLS
using thesettings.dist.py
default provided in the image.