Giter Site home page Giter Site logo

cartel32 / hephaestus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yezz123-archive/hephaestus

0.0 0.0 0.0 163 KB

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

License: Apache License 2.0

Python 89.17% Dockerfile 6.57% Shell 4.26%

hephaestus's Introduction

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:password@db/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.

hephaestus's People

Contributors

yezz123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.