Flask-MonitoringDashboard
Flask-MonitoringDashboard copied to clipboard
programmatically exclude endpoints
It is great to be able to change the monitoring level in the ui. Having a lot of endpoints (that are e.g. generated by Flask-Admin), I do not want to monitor nor see those or even others I created manually in the dashboard overview. Thus I would like to see a feature where I could ignore endpoints completely and define this in code. E.g.
app.config["flask_monitoringdashboard"] = {
"ignore": [
"^/static/.*",
".*/foobar/.*",
]
}
Or endpoint declarations after bind() will be hidden to the dashboard.
Hi Sebastian,
This is a nice idea actually 👍 Do you think you could give a first stab at implementing it and sending a PR? :)
Cheers! M.
Hi,
Will try. Can you point me to the module where you see this code living?
Have a look at flask_monitoringdashboard/core/measurement.py
, that's where the wrappers are added. The function init_measurement()
is where that starts.
Hi, I know it's been a while but this may be helpful to other people.
While you can't configure the monitoring level of each endpoint using this library, you can do so by directly querying the database where the monitoring data is stored using an ORM library such as sqlalchemy
.
This should not be hard to do... in fact, it could be a nice first task for somebody who wants to join the project!