Restful Api developed with Flask using Prometheus and Grafana for monitoring and containerization with Docker :rocket:

Overview

School of Athena

Hephaestus πŸš€

  • In Greek mythology, Hephaestus was either the son of Zeus and Hera or he was Hera's parthenogenous child. ... As a smithing god, Hephaestus made all the weapons of the gods in Olympus. He served as the blacksmith of the gods, and was worshipped in the manufacturing and industrial centres of Greece, particularly Athens.

Get Started πŸš€

  • An Restful Api project developed with Flask.

  • I used Prometheus and Grafana for monitoring and containerization with Docker.

Monitoring

  • Using Prometheus Flask exporter This library provides HTTP request metrics to export into Prometheus. It can also track method invocations using convenient functions.

  • Grafana is a multi-platform open source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources.

containerization

  • Docker hosts and containers monitoring with Prometheus, Grafana, Flask, MySQL.

  • To run the project you need docker-compose and run this command:

docker-compose up -d
  • To stop:
docker-compose down

Requirements πŸš€

Installation

  • Get started by cloning the repository :
git clone https://github.com/yezz123/Hephaestus
pip install -r requirements.txt
  • Then in your app/init.py change the MYSQL connection :

or you can use wait for mysql to launch and connect to your mysql Provider.

db = SQLAlchemy()

SQLALCHEMY_DATABASE_URI = "mysql+pymysql://username:[email protected]/Database_db"
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False

Notes : You can Change the SQLALCHEMY Database to SQLite for example :

SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/test.db"

Curl

  • Curl is used in command lines or scripts to transfer data.

Routes

  • "/" : show information's about what routes are available.

  • "/fibonacci/" : the n-th fibonacci number.

  • "/power//" : show power of first number to second number

  • "/factorial/" : show the factorial of a number

  • "/get_requests" : show all requests saved in DB

  • "/metric" : show metrics

Ports

  • On port 9090 is a instance of Prometheus that collect metrics from the Flask app.

  • On port 3000 is an instance of Grafana that displays the data collected by Prometheus (user: admin, pass: admin).

  • To see the Grafana dashboard:

  • localhost:3000/grafana

Contributing ⭐

  • Contributions are welcome ❀️

  • Please share any features, and add unit tests!

  • Use the pull request and issue systems to contribute.

Credits & Thanks πŸ†

Medium Twitter Discord

Owner
Yasser Tahiri
Backend Developer πŸ‘¨πŸΌβ€πŸ’» who speaks @python. 🐍 Creator of @BnademOverflow. I love Open Source & Ancient Greece.
Yasser Tahiri
A minimum reproducible repository for embedding panel in FastAPI

FastAPI-Panel A minimum reproducible repository for embedding panel in FastAPI Follow either This Tutorial or These steps below ↓↓↓ Clone the reposito

Tyler Houssian 15 Sep 22, 2022
Simple example of FastAPI + Celery + Triton for benchmarking

You can see the previous work from: https://github.com/Curt-Park/producer-consumer-fastapi-celery https://github.com/Curt-Park/triton-inference-server

Jinwoo Park (Curt) 37 Dec 29, 2022
API using python and Fastapi framework

Welcome πŸ‘‹ CFCApi is a API DEVELOPMENT PROJECT UNDER CODE FOR COMMUNITY ! Project Walkthrough πŸš€ CFCApi run on Python using FASTapi Framework Docs The

Abhishek kushwaha 7 Jan 02, 2023
Learn to deploy a FastAPI application into production DigitalOcean App Platform

Learn to deploy a FastAPI application into production DigitalOcean App Platform. This is a microservice for our Try Django 3.2 project. The goal is to extract any and all text from images using a tec

Coding For Entrepreneurs 59 Nov 29, 2022
Farlimit - FastAPI rate limit with python

FastAPIRateLimit Contributing is F&E (free&easy) Y Usage pip install farlimit N

omid 27 Oct 06, 2022
Town / City geolocations with FastAPI & Mongo

geolocations-api United Kingdom Town / City geolocations with FastAPI & Mongo Build container To build a custom image or extend the api run the follow

Joe Gasewicz 3 Jan 26, 2022
FastAPI CRUD template using Deta Base

Deta Base FastAPI CRUD FastAPI CRUD template using Deta Base Setup Install the requirements for the CRUD: pip3 install -r requirements.txt Add your D

Sebastian Ponce 2 Dec 15, 2021
Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python 3.6 and above with performance auto-tuning. Optionally with Alpine Linux.

Supported tags and respective Dockerfile links python3.8, latest (Dockerfile) python3.7, (Dockerfile) python3.6 (Dockerfile) python3.8-slim (Dockerfil

SebastiΓ‘n RamΓ­rez 2.1k Dec 31, 2022
Reusable utilities for FastAPI

Reusable utilities for FastAPI Documentation: https://fastapi-utils.davidmontague.xyz Source Code: https://github.com/dmontagu/fastapi-utils FastAPI i

David Montague 1.3k Jan 04, 2023
Code Specialist 27 Oct 16, 2022
Sample FastAPI project that uses async SQLAlchemy, SQLModel, Postgres, Alembic, and Docker.

FastAPI + SQLModel + Alembic Sample FastAPI project that uses async SQLAlchemy, SQLModel, Postgres, Alembic, and Docker. Want to learn how to build th

228 Jan 02, 2023
FastAPI native extension, easy and simple JWT auth

fastapi-jwt FastAPI native extension, easy and simple JWT auth

Konstantin Chernyshev 19 Dec 12, 2022
Cache-house - Caching tool for python, working with Redis single instance and Redis cluster mode

Caching tool for python, working with Redis single instance and Redis cluster mo

Tural 14 Jan 06, 2022
A comprehensive CRUD API generator for SQLALchemy.

FastAPI Quick CRUD Introduction Advantage Constraint Getting started Installation Usage Design Path Parameter Query Parameter Request Body Upsert Intr

192 Jan 06, 2023
Fetching Cryptocurrency Prices from Coingecko and Displaying them on Grafana

cryptocurrency-prices-grafana Fetching Cryptocurrency Prices from Coingecko and Displaying them on Grafana About This stack consists of: Prometheus (t

Ruan Bekker 7 Aug 01, 2022
πŸ”€β³ Easy throttling with asyncio support

Throttler Zero-dependency Python package for easy throttling with asyncio support. πŸ“ Table of Contents πŸŽ’ Install πŸ›  Usage Examples Throttler and Thr

Ramzan Bekbulatov 80 Dec 07, 2022
Prometheus exporter for Starlette and FastAPI

starlette_exporter Prometheus exporter for Starlette and FastAPI. The middleware collects basic metrics: Counter: starlette_requests_total Histogram:

Steve Hillier 225 Jan 05, 2023
Stac-fastapi built on Tile38 and Redis to support caching

stac-fastapi-caching Stac-fastapi built on Tile38 to support caching. This code is built on top of stac-fastapi-elasticsearch 0.1.0 with pyle38, a Pyt

Jonathan Healy 4 Apr 11, 2022
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

Kirill Klenov 871 Dec 25, 2022
Restful Api developed with Flask using Prometheus and Grafana for monitoring and containerization with Docker :rocket:

Hephaestus πŸš€ In Greek mythology, Hephaestus was either the son of Zeus and Hera or he was Hera's parthenogenous child. ... As a smithing god, Hephaes

Yasser Tahiri 16 Oct 07, 2022