flask-graphite icon indicating copy to clipboard operation
flask-graphite copied to clipboard

Metrics a levels deeper

Open Mohamed-0-Hassan opened this issue 7 years ago • 2 comments

@app.route('/person'): # measure total call and duration some validation check database call # measure total call and duration

i do some validation checks and then execute a database call. Is it also possible to have a tree that shows the pt and count of the database call

Mohamed-0-Hassan avatar Oct 11 '18 22:10 Mohamed-0-Hassan

Hi @Mohamed-0-Hassan!

We don't implement anything for this in Flask-Graphite so far, but the library on which it is based, graphitesend, might help you here.

That being said, I would love that we make it possible. An easy way would be to have a decorator that you could apply on any kind of function to have more insights. Something around those lines:

from flask_graphite import send_metrics
...

@send_metrics
def call_database(...):
    ...

@app.route('/person')
def get_person(...):
    ...
    call_database(...)
    ...

Feel free to make a PR if you feel like you could achieve this!

ping @Shir0kamii

ramnes avatar Oct 12 '18 08:10 ramnes

Hi!

This is planned for graphitesender (replacement for graphitesend). It'll come in the following weeks.

Then we could just proxy those features in flask_graphite.

Shir0kamii avatar Oct 12 '18 17:10 Shir0kamii