https://github.com/kludex/fastapi-prometheus-grafana
FasAPI + Prometheus + Grafana! :tada:
https://github.com/kludex/fastapi-prometheus-grafana
Last synced: 4 months ago
JSON representation
FasAPI + Prometheus + Grafana! :tada:
- Host: GitHub
- URL: https://github.com/kludex/fastapi-prometheus-grafana
- Owner: Kludex
- License: mit
- Created: 2020-11-29T01:51:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T09:10:16.000Z (almost 2 years ago)
- Last Synced: 2025-04-02T23:13:36.014Z (6 months ago)
- Language: Python
- Homepage:
- Size: 258 KB
- Stars: 197
- Watchers: 5
- Forks: 51
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FastAPI + Prometheus + Grafana :tada:
This is a minimal setup that you can build to monitor your FastAPI microservice.
## Installation
There are only two prerequisites:
* [Docker](https://docs.docker.com/get-docker/)
* [Docker-compose](https://docs.docker.com/compose/install/)Having both, you'll need to clone the repository:
``` bash
git clone https://github.com/Kludex/fastapi-prometheus-grafana
```## Usage
You'll need to run the docker containers:
``` bash
docker-compose up
```Now you have access to those three containers and their respective ports:
* Prometheus: http://localhost:9090/
* Grafana: http://localhost:3000/
* FastAPI: http://localhost:8000/On the FastAPI, you can access `/metrics` endpoint to see the data Prometheus is scraping from it.
## How it looks like
![]()
## References
* [Prometheus FastAPI Instrumentator](https://github.com/trallnag/prometheus-fastapi-instrumentator)
* [Generate and Track Metrics for Flask API Applications Using Prometheus and Grafana](https://medium.com/swlh/generate-and-track-metrics-for-flask-api-applications-using-prometheus-and-grafana-55ddd39866f0)
* [PromQL for Humans](https://timber.io/blog/promql-for-humans/)