Flask-MonitoringDashboard icon indicating copy to clipboard operation
Flask-MonitoringDashboard copied to clipboard

programmatically exclude endpoints

Open sebastianelsner opened this issue 3 years ago • 5 comments

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.

sebastianelsner avatar Aug 30 '20 12:08 sebastianelsner

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.

mircealungu avatar Aug 30 '20 13:08 mircealungu

Hi,

Will try. Can you point me to the module where you see this code living?

sebastianelsner avatar Aug 31 '20 07:08 sebastianelsner

Have a look at flask_monitoringdashboard/core/measurement.py, that's where the wrappers are added. The function init_measurement() is where that starts.

dejagersh avatar Aug 31 '20 08:08 dejagersh

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.

Voltini avatar Aug 25 '23 07:08 Voltini

This should not be hard to do... in fact, it could be a nice first task for somebody who wants to join the project!

mircealungu avatar Aug 29 '23 08:08 mircealungu