Git Product home page Git Product logo

itu-minitwit-monitoring's Introduction

This is the basic ITU_MiniTwit application (Python 3 and SQLite) with added support for monitoring with Prometheus and Grafana as a Dashboard.

The application is Dockerized. To build the application and a client which simulates users clicking around the front page you have to:

  • Build the application:
$ docker build -f docker/minitwit/Dockerfile -t <youruser>/webserver .
  • Build the test client:
$ docker build -f docker/minitwit_client/Dockerfile -t <youruser>/minitwitclient .
  • Start the application:
$ docker-compose up

Alternatively, you can build and run the application in one step:

$ docker-compose up --build

To stop the application again run:

$ docker-compose down -v

After starting the entire application, you can reach:

Starting Grafana and Instantiating a Dashboard

Navigate your browser to http://localhost:3000 and login with the default credentials admin/admin. Remember later to change the password for your projects!

Now, do the following:

  • Add data source

  • Set the Name to a name that you deem suitable
  • Under Config choose the Type Prometheus
  • Under Http settings set the Url to http://prometheus:9090
  • Finally, click Add

Now, Create your first dashboard:

Add a SingleStat click on the Panel Title and choose Edit.

Keep Data Source as default and add the PromQL query minitwit_http_responses_total to the field below.

Now, play and customize the dashboard a bit to your liking and add some other metrics.

Installing new Panels

In case you need another panel type for example a gauge for the CPU load and in case you are running Grafana via Docker follow the steps below.

$ docker exec -it itu-minitwit-monitoring_grafana_1 /bin/bash
root@9c17c8757ffb:/# grafana-cli plugins install briangann-gauge-panel
installing briangann-gauge-panel @ 0.0.6
from url: https://grafana.com/api/plugins/briangann-gauge-panel/versions/0.0.6/download
into: /var/lib/grafana/plugins

โœ” Installed briangann-gauge-panel successfully

Restart grafana after installing plugins . <service grafana-server restart>

root@9c17c8757ffb:/# exit
exit
$ docker restart itu-minitwit-monitoring_grafana_1
itu-minitwit-monitoring_grafana_1

This minitwit.py application was adapted to be monitored with Prometheus with the help of this blog post.

itu-minitwit-monitoring's People

Contributors

helgecph avatar duckapple avatar

Watchers

James Cloos 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.