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
REST API with FastAPI and PostgreSQL

REST API with FastAPI and PostgreSQL To have the same data in db: create table CLIENT_DATA (id SERIAL PRIMARY KEY, fullname VARCHAR(50) NOT NULL,email

Luis Quiรฑones Requelme 1 Nov 11, 2021
Ansible Inventory Plugin, created to get hosts from HTTP API.

ansible-ws-inventory-plugin Ansible Inventory Plugin, created to get hosts from HTTP API. Features: Database compatible with MongoDB and Filesystem (J

Carlos Neto 0 Feb 05, 2022
A simple Blogging Backend app created with Fast API

This is a simple blogging app backend built with FastAPI. This project is created to simulate a real CRUD blogging system. It is built to be used by s

Owusu Kelvin Clark 13 Mar 24, 2022
cookiecutter template for web API with python

Python project template for Web API with cookiecutter What's this This provides the project template including minimum test/lint/typechecking package

Hitoshi Manabe 4 Jan 28, 2021
๐Ÿš€ Cookiecutter Template for FastAPI + React Projects. Using PostgreSQL, SQLAlchemy, and Docker

FastAPI + React ยท A cookiecutter template for bootstrapping a FastAPI and React project using a modern stack. Features FastAPI (Python 3.8) JWT authen

Gabriel Abud 1.4k Jan 02, 2023
Adds integration of the Chameleon template language to FastAPI.

fastapi-chameleon Adds integration of the Chameleon template language to FastAPI. If you are interested in Jinja instead, see the sister project: gith

Michael Kennedy 124 Nov 26, 2022
Single Page App with Flask and Vue.js

Developing a Single Page App with FastAPI and Vue.js Want to learn how to build this? Check out the post. Want to use this project? Build the images a

91 Jan 05, 2023
Practice-python is a simple Fast api project for dealing with modern rest api technologies.

Practice Python Practice-python is a simple Fast api project for dealing with modern rest api technologies. Deployment with docker Go to the project r

0 Sep 19, 2022
Prometheus exporter for metrics from the MyAudi API

Prometheus Audi Exporter This Prometheus exporter exports metrics that it fetches from the MyAudi API. Usage Checkout submodules Install dependencies

Dieter Maes 7 Dec 19, 2022
Prometheus exporter for several chia node statistics

prometheus-chia-exporter Prometheus exporter for several chia node statistics It's assumed that the full node, the harvester and the wallet run on the

30 Sep 19, 2022
Turns your Python functions into microservices with web API, interactive GUI, and more.

Instantly turn your Python functions into production-ready microservices. Deploy and access your services via HTTP API or interactive UI. Seamlessly export your services into portable, shareable, and

Machine Learning Tooling 2.8k Jan 04, 2023
A FastAPI Framework for things like Database, Redis, Logging, JWT Authentication and Rate Limits

A FastAPI Framework for things like Database, Redis, Logging, JWT Authentication and Rate Limits Install You can install this Library with: pip instal

Tert0 33 Nov 28, 2022
Adds GraphQL support to your Flask application.

Flask-GraphQL Adds GraphQL support to your Flask application. Usage Just use the GraphQLView view from flask_graphql from flask import Flask from flas

GraphQL Python 1.3k Dec 31, 2022
FastAPI with async for generating QR codes and bolt11 for Lightning Addresses

sendsats An API for getting QR codes and Bolt11 Invoices from Lightning Addresses. Share anywhere; as a link for tips on a twitter profile, or via mes

Bitkarrot 12 Jan 07, 2023
FastAPI simple cache

FastAPI Cache Implements simple lightweight cache system as dependencies in FastAPI. Installation pip install fastapi-cache Usage example from fastapi

Ivan Sushkov 188 Dec 29, 2022
์Šคํƒ€ํŠธ์—… ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ

์Šคํƒ€ํŠธ์—… ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ ๅคง ๋ฐ•๋žŒํšŒ Seed ~ Series B์— ์žˆ๋Š” ์Šคํƒ€ํŠธ์—…์„ ์œ„ํ•œ ์ฑ„์šฉ์ •๋ณด ํŽ˜์ด์ง€์ž…๋‹ˆ๋‹ค. Back-end, Frontend, Mobile ๋“ฑ ๊ฐœ๋ฐœ์ž๋ฅผ ๋Œ€์ƒ์œผ๋กœ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ์Šคํƒ€ํŠธ์—…์— ์ข…์‚ฌํ•˜์‹œ๋Š” ๋ถ„๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์ฑ„์šฉ ๊ด€๋ จ ์ •๋ณด๋ฅผ ์•Œ๊ณ  ๊ณ„์‹œ๋‹ค๋ฉด

JuHyun Lee 58 Dec 14, 2022
FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.

็ฎ€ไฝ“ไธญๆ–‡ | English ้กน็›ฎไป‹็ป FastAPI-Amis-Admin fastapi-amis-adminๆ˜ฏไธ€ไธชๆ‹ฅๆœ‰้ซ˜ๆ€ง่ƒฝ,้ซ˜ๆ•ˆ็Ž‡,ๆ˜“ๆ‹“ๅฑ•็š„fastapi็ฎก็†ๅŽๅฐๆก†ๆžถ. ๅฏๅ‘่‡ชDjango-Admin,ๅนถไธ”ๆ‹ฅๆœ‰ไธ้€Š่‰ฒไบŽDjango-Admin็š„ๅผบๅคงๅŠŸ่ƒฝ. ๆบ็  ยท ๅœจ็บฟๆผ”็คบ ยท ๆ–‡ๆกฃ ยท ๆ–‡

AmisAdmin 318 Dec 31, 2022
api versioning for fastapi web applications

fastapi-versioning api versioning for fastapi web applications Installation pip install fastapi-versioning Examples from fastapi import FastAPI from f

Dean Way 472 Jan 02, 2023
Utils for fastapi based services.

Installation pip install fastapi-serviceutils Usage For more details and usage see: readthedocs Development Getting started After cloning the repo

Simon Kallfass 31 Nov 25, 2022
Sample-fastapi - A sample app using Fastapi that you can deploy on App Platform

Getting Started We provide a sample app using Fastapi that you can deploy on App

Erhan BรœTE 2 Jan 17, 2022