You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Markus Bergholz 51f1cbfb1d Update README 1 week ago
.gitlab-ci.yml build docker image with gitlab ci 1 week ago
Dockerfile 1st draft 1 week ago
LICENSE Initial commit 1 week ago
README.md Update README 1 week ago
dsm2mariadb.py 1st draft 1 week ago
dsm_grafana.png 1st draft 1 week ago
run.sh 1st draft 1 week ago

README.md

Docker Swarm Mode Metrics

dsm-grafana

Requirements

  • Grafana
  • MariaDB >= 10.3
  • Docker Swarm Mode

Data Structure

On MariaDB we use the “versioned table” feature.
That means:

  1. history is available for the nodes status
  2. only changes on node status waste storage - doesn’t matter which intervall you’re using.
CREATE TABLE manager_status (
	Availability char(16),
	EngineVersion char(16),
	Hostname char(16),
	ID char(32),
	ManagerStatus char(16),
	`Self` bool,
	Status char(16),
	TLSStatus char(16),
	PRIMARY KEY (`Hostname`),
    INDEX `idx_manager_status` (`ManagerStatus`),
    INDEX `idx_status` (`Status`),
    INDEX `idx_availability` (`Availability`)
) WITH SYSTEM VERSIONING
  PARTITION BY SYSTEM_TIME (
    PARTITION p_hist HISTORY,
    PARTITION p_cur CURRENT
  );

Deployment

Requirements:

  • Mariadb >= 10.3 is deployed in the same network (in this example, also in the core network).
  • The database is manually created
  • mariadb_passwords is a docker secret
docker service create \
    --name dsm_metrics \
    --network core \
    -e MARIADB_USER=root \
    -e MARIADB_DATABASE=dsm \
    -e MARIADB_PORT=3306 \
    -e MARIADB=mariadb \
    --secret mariadb_passwords \
    --mount type=bind,source=/run/docker.sock,destination=/var/run/docker.sock \
    --constraint node.role==manager \
    registry.gitlab.com/markuman/dsm-grafana:1

TODO

  • Ansible Playbooks
    • Docker Service Deployment
    • Grafana Dashboard
  • Docker HealthCheck
    • Deletes history data > n days?