Skip to content

emeli-dral/postgres_push_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgres_push_example

An example of data monitoring setup using Evidently tool, Postgres DG and Grafana service. Evidently_Postgres_Grafana_dashboard

Prerequisites

You need following tools installed:

  • docker
  • docker-compose (included to Docker Desktop for Mac and Docker Desktop for Windows )

Preparation

Note: all actions expected to be executed in repo folder.

Create virtual environment and activate it (eg. python -m venv venv && ./venv/bin/activate)

Install required packages pip install -r requirements.txt

Starting services

Go to the project directory and run the following command from the terminal: docker-compose up --build Note:

  • to stop the docker later, run: docker-compose down;
  • to rebuild docker image (for example, to get the latest version of the libraries) run: docker compose build --no-cache

Sending Data

To start sending data to service, execute: python data_loader.py

This script will expose a single batch of calculated metrics through prometheus pushgateway every 10 seconds

Setting up Dashboards

  • Run the example using the above instructions
  • Open the Grafana web interface (localhost:3000)
  • Create new Dashboard, add a Panel, and make sure you selected PostgreSQL as a source

Screenshot 2023-03-13 at 12 51 38

  • Customize visuals in the Grafana interface

Screenshot 2023-03-13 at 12 47 25

  • Apply your changes to the Dashboard and check that you like what you see :)
  • Click the button "save" from the Grafana Top Menu. This will open a dialog window. Select the option "Download JSON" to save the configurations in the JSON file if like to reuse it later.

About

An example of data monitoring setup using Evidently tool, Postgres DG and Grafana service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages