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
Deploy/View images to database sqlite with fastapi

Deploy/View images to database sqlite with fastapi cd realistic Dependencies dat

Fredh Macau 1 Jan 04, 2022
๐Ÿ Simple FastAPI template with factory pattern architecture

Description This is a minimalistic and extensible FastAPI template that incorporates factory pattern architecture with divisional folder structure. It

Redowan Delowar 551 Dec 24, 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
ไบฌไธœๅ›พ็‰‡็‚นๅ‡ป้ชŒ่ฏ็ ่ฏ†ๅˆซ

ไบฌไธœๅ›พ็‰‡้ชŒ่ฏ็ ่ฏ†ๅˆซ ๆœฌ้กน็›ฎๆ˜ฏ@yqchilde ๅคงไฝฌ็š„ JDMemberCloseAccount ่ฏ†ๅˆซๅ›พๅฝข้ชŒ่ฏ็ (#45)ๆ€่ทฏ้ชŒ่ฏ๏ผŒ่‹ฅไฝ ไนŸๆœ‰ๆ€่ทฏๅฏไปฅๆไบคIssueๅ’ŒPRไนŸๅฏไปฅๅœจ @yqchilde ็š„ TG็พค ๆ‰พๅˆฐๆˆ‘ ๅฃฐๆ˜Ž ๆœฌ่„šๆœฌๅชๆ˜ฏไธบไบ†ๅญฆไน ็ ”็ฉถไฝฟ็”จ ๆœฌ่„šๆœฌ้™คไบ†้‡‡้›†ๅค„็†้ชŒ่ฏ็ ๅ›พ็‰‡ๆฒกๆœ‰ๅ…ถไป–ไปปไฝ•ๅŠŸ่ƒฝ๏ผŒไนŸ

AntonVanke 37 Dec 22, 2022
Get MODBUS data from Sofar (K-TLX) inverter through LSW-3 or LSE module

SOFAR Inverter + LSW-3/LSE Small utility to read data from SOFAR K-TLX inverters through the Solarman (LSW-3/LSE) datalogger. Two scripts to get inver

58 Dec 29, 2022
API for Submarino store

submarino-api API for the submarino e-commerce documentation read the documentation in: https://submarino-api.herokuapp.com/docs or in https://submari

Miguel 1 Oct 14, 2021
implementation of deta base for FastAPIUsers

FastAPI Users - Database adapter for Deta Base Ready-to-use and customizable users management for FastAPI Documentation: https://fastapi-users.github.

2 Aug 15, 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
โœจ๏ธ๐Ÿ SPARQL endpoint built with RDFLib to serve machine learning models, or any other logic implemented in Python

โœจ SPARQL endpoint for RDFLib rdflib-endpoint is a SPARQL endpoint based on a RDFLib Graph to easily serve machine learning models, or any other logic

Vincent Emonet 27 Dec 19, 2022
FastAPI with Docker and Traefik

Dockerizing FastAPI with Postgres, Uvicorn, and Traefik Want to learn how to build this? Check out the post. Want to use this project? Development Bui

51 Jan 06, 2023
Easily integrate socket.io with your FastAPI app ๐Ÿš€

fastapi-socketio Easly integrate socket.io with your FastAPI app. Installation Install this plugin using pip: $ pip install fastapi-socketio Usage To

Srdjan Stankovic 210 Dec 23, 2022
A simple example of deploying FastAPI as a Zeit Serverless Function

FastAPI Zeit Now Deploy a FastAPI app as a Zeit Serverless Function. This repo deploys the FastAPI SQL Databases Tutorial to demonstrate how a FastAPI

Paul Weidner 26 Dec 21, 2022
fastapi-cache is a tool to cache fastapi response and function result, with backends support redis and memcached.

fastapi-cache Introduction fastapi-cache is a tool to cache fastapi response and function result, with backends support redis, memcache, and dynamodb.

long2ice 551 Jan 08, 2023
Repository for the Demo of using DVC with PyCaret & MLOps (DVC Office Hours - 20th Jan, 2022)

Using DVC with PyCaret & FastAPI (Demo) This repo contains all the resources for my demo explaining how to use DVC along with other interesting tools

Tezan Sahu 6 Jul 22, 2022
Asynchronous event dispatching/handling library for FastAPI and Starlette

fastapi-events An event dispatching/handling library for FastAPI, and Starlette. Features: straightforward API to emit events anywhere in your code ev

Melvin 238 Jan 07, 2023
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
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
Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Max Countryman 310 Dec 14, 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
์Šคํƒ€ํŠธ์—… ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ

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

JuHyun Lee 58 Dec 14, 2022