Skip to content

ricardohsmello/grafana-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This project aims to demonstrate how to set up grafana + postgres with docker-compose.

You can read more on my medium article.

Built With

  • Grafana - Analytics and monitoring platform
  • Docker - Containerized Application Deployment
  • PostgreSQL - Relational Database Management

Prerequisites

Usage

Clone repository

git clone https://github.com/ricardohsmello/grafana-docker.git

Starting container

cd grafana-docker
docker-compose up -d

Accessing grafana

- http://localhost:3000

 - username = admin
 - password = admin

Visualization queries

Distribution of Revenue by Product

SELECT
    product_name,
    SUM(revenue) AS value
FROM
    sales_data
GROUP BY
    product_name

Units sold by product

SELECT
    product_name,
    SUM(units_sold) AS value
FROM
    sales_data
GROUP BY
    product_name

Sales Over Time

SELECT
    sale_date AS time,
    SUM(units_sold) AS total_sales
FROM
    sales_data
GROUP BY
    sale_date

Total available Items

select product_name,
    MAX(stock_available) AS value
FROM
    sales_data
GROUP BY
    product_name