trallnag / prometheus-fastapi-instrumentator

Instrument your FastAPI with Prometheus metrics.
ISC License
950 stars 84 forks source link

Grafana dashboard template for displaying the default metrics #12

Open DirkSchneemann-TomTom opened 4 years ago

DirkSchneemann-TomTom commented 4 years ago

Hello,

most people use Prometheus together with Grafana. It would be great if there was a dashboard template hosted at https://grafana.com/grafana/dashboards which shows at least the default metrics from the library (custom ones could be added individually as desired). These dashboards can easily be imported into a running Grafana instance, hence saving users the hassle to create a dashboard on their own.

Cheers

trallnag commented 4 years ago

Yeah I think something like this would be helpful for starting off. Similar to https://github.com/rycus86/prometheus_flask_exporter

But it's almost impossible in my opinion to find a dashboard that suits everyone. Do you only have a single application you are monitoring? Or dozens of services running in a Kubernetes cluster? A lot of variables here that require (vastly) different dashboards or at least changes to the used labels etc. I'll see when I get around to create / upload a show case, thanks for raising the idea

Kludex commented 3 years ago

@trallnag I'm still working on it, but this may be useful just as an example https://github.com/Kludex/fastapi-prometheus-grafana

sorasful commented 2 years ago

Hey @Kludex ! Just wanted to know if you had found any good resources that one could use to get easy dashboards for a fastapi app, this would be so cool ! Thanks !

unidesigner commented 2 years ago

@sorasful Have you been successful in finding a solution. The repo from @Kludex is very useful for the configured dashboard for the variables that are exposed via the /metrics endpoint. However I am stuck with how to define the proper data source in Grafana (the Promotheus data source refers to the server, not the output of this plugin. I wonder if the path is to implement a custom Grafana data source via plugin to fetch and parse the relevant data, but I think there should be another way, so I'd like to ask first here.

sorasful commented 2 years ago

@unidesigner Not really, I need to get more resources on how PromQL works and stuff. If I manage to get something nice for these dashboard I think I'll make a PR so this can goes into an "example" section for example.

susowiki commented 1 year ago

Hi, any update about this?

trallnag commented 7 months ago

@susowiki it's not on my todo list. In my personal projects and at work I have not been using this package in a long time due to working with other programming languages. So when it comes to prometheus-fastapi-instrumentator I really only find the motivation every few months to streamline and merge open PRs, fix small bugs, update dependencies, etc.