geonode-project
geonode-project copied to clipboard
Monitoring API returns no data in a proxy environment
Monitoring API does not return any data in my environment with proxy.
Sample request is the following:
http://my_proxy/monitoring/api/metric_data/mem.free/","query":{"service":"my_proxy-hostgeonode","last":"600","interval":"600
This returns:
{"data":{"metric":"mem.free","input_valid_from":"2020-08-19T13:03:58.426725Z","input_valid_to":"2020-08-19T13:13:58.426725Z","interval":600,"label":null,"type":"value_numeric","axis_label":"B","data":[{"valid_from":"2020-08-19T13:03:58.426725Z","valid_to":"2020-08-19T13:13:58.426725Z","data":[]}]}}
The same configuration works fine in my local environment.
Does monitoring API require any additional setting for proxy?
Had the same problem while running with docker-compose behind a traefik proxy.
I managed to solve this by using docker-compose service name instead of the full domain for the service url: http://django:8000/
To set this you cannot use the django admin as the domain is considered invalid because it misses the TDL, this is a limit of the Django URLField validation, see https://code.djangoproject.com/ticket/25418