Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.19 KB

README.md

File metadata and controls

56 lines (37 loc) · 1.19 KB

Simple example of using PostgreSQL exporters

quay.io/prometheuscommunity/postgres-exporter

A PostgreSQL metric exporter for Prometheus

Used for DB metrics and config info (system monitoring)

burningalchemist/sql_exporter

Database agnostic SQL exporter for Prometheus - for SQL Queries.

Used to create SQL queries to the database, receive and output business metrics (to display real-time data from the database in Grafana)

Run

docker compose up -d

Import demo data for testing

docker compose exec db bash
psql -U pguser -d netflix < /tmp/netflix.sql 

Find the directors with the most movies in the database sql_collectors/netflix.collector.yml:

SELECT 
    director,
    COUNT(*) AS "Number of Movies"
FROM 
    netflix_shows
WHERE 
    type = 'Movie' and director is not null
GROUP BY 
    director
ORDER BY 
    "Number of Movies" DESC
LIMIT 5;

SQL Exporter

sql-exporter

PostgreSQL exporter

postgres-exporter