Closed ochaplashkin closed 1 year ago
Collecting metrics from each endpoint is a bad practice (if the service is on a public network, it can be attacked, scanned, etc).
Now the metrics will be grouped by handler functions and will not grow.
For example:
@app.get('/') def index(): ... @app.post('/') def webhook(): ...
If you try to scan/hack (i.e. send a lot of requests), you will have only two metrics for the two paths:
flask_http_<...>{endpoint="index", method="GET", status="404"} flask_http_<...>{endpoint="webhook", method="GET", status="404"}
instead of N metrics for the two paths, where N is count of requests:
flask_http_<...>{method="GET",path="/foo",status="404"} flask_http_<...>{method="POST",path="/bar",status="404"}
Close #34
Collecting metrics from each endpoint is a bad practice (if the service is on a public network, it can be attacked, scanned, etc).
Now the metrics will be grouped by handler functions and will not grow.
For example:
If you try to scan/hack (i.e. send a lot of requests), you will have only two metrics for the two paths:
instead of N metrics for the two paths, where N is count of requests:
Close #34