![]() Don't forget, we were running everything in Docker Containers, albiet the whole platform was running on our local machine using Docker Compose. ![]() We’ve done all the monitoring part with installation of DB times series, exports and UI visualization.In our last post,, we took our UI automation project to capture metrics on Synthetic Transactions, and setup Prometheus and Grafana to continuously pull those metrics and show them in a dashboard. It’s simple just import the next dashboards, with Prometheus as data source, same as previous for Docker Swarm dashboard : Now it’s time to end this by some new optimized dashboards for data metrics ! Then restart Prometheus service and go back to targets to check you have all new data-01 endpoints. job_name : "node-exporter-data-01" static_configs : - targets : - job_name : "mysql-exporter-data-01" static_configs : - targets : - job_name : "postgres-exporter-data-01" static_configs : - targets : #. We have done for the cluster metrics part but what about the external data-01 host and databases ? Just more exporters of course ! Node exporter for data #įor node exporter, we have no other choice to install it locally as a service binary, so we must go through old fashion install. External node, MySQL and PostgreSQL exports # Just edit the card and change the PromQL inside Metrics browser field by replacing device="rootfs", mountpoint="/" by device="/dev/sda1", mountpoint="/host". The Available Disk Space metrics card should indicate N/A because not properly configured for Hetzner disks. Then go to Create > Import, load 11939 as dashboard ID, and select Prometheus source and woha! Select Prometheus and set the internal docker prometheus URL, which should be A successful message should appear when saving. ![]() Go to Configuration > Data source menu and click on Add data source. Go to and login as admin / admin.įor best show-case scenario of Grafana, let’s import an existing dashboard suited for complete Swarm monitor overview.įirst we need to add Prometheus as main metrics data source. Database migration should be automatic (don’t hesitate to check inside pgAdmin). Set proper GF_DATABASE_PASSWORD and deploy. Version : '3.8' services : grafana : image : grafana/grafana:latest environment : GF_SERVER_DOMAIN : grafana.sw. GF_SERVER_ROOT_URL : GF_DATABASE_TYPE : postgres GF_DATABASE_HOST : data-01:5432 GF_DATABASE_NAME : grafana GF_DATABASE_USER : grafana GF_DATABASE_PASSWORD : GF_REMOTE_CACHE_TYPE : redis GF_REMOTE_CACHE_CONNSTR : addr=data-01:6379,pool_size=100,db=0,ssl=false volumes : - /etc/hosts:/etc/hosts - /mnt/storage-pool/grafana:/var/lib/grafana networks : - traefik_public deploy : labels : - traefik.enable=true - .entrypoints=https - .middlewares=admin-ip - .=3000 placement : constraints : - node.role = manager networks : traefik_public : external : true Go to Configs menu inside Portainer and add a node_exporter_entrypoint config file with next content : In order to avoid have a file to put on each host, we’ll use the config docker feature availabe in swarm mode. This is because we run node exporter as docker container, which have no clue of original node hostname.īesides this node exporter (like cAdvisor) work as an agent which must be deployed in global mode. Node exporter for more global node (aka host) level metricsīefore edit above stack, we need to make a specific docker entry point for node exporter that will help us to fetch the original hostname of the docker host machine name.cAdvisor from Google which scrape metrics of all running containers.We have the monitor brain, now it’s time to have some more relevant metrics data from all containers as well as docker nodes. In Status > Targets, you should have 2 endpoints enabled, which correspond to above scrape config. You should now have access to some metrics ! Next config are useful in order to control the DB usage, as metrics can go up very quickly : argumentĭeploy it and should be available after few seconds. The private network will serve us later for exporters. Version : '3.8' services : prometheus : image : prom/prometheus networks : - private - traefik_public command : - config.file=/etc/prometheus/prometheus.yml - =5GB - =15d volumes : - /etc/hosts:/etc/hosts - /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - data:/prometheus deploy : placement : constraints : - = true labels : - traefik.enable=true - .entrypoints=https - .middlewares=admin-ip,admin-auth - .=9090 networks : private : traefik_public : external : true volumes : data :
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |