Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

UNLIMITED

Linux Format

Collect and graph metrics with Python

We collect metrics because we want to explore and understand a situation. This is usually because there’s a need to improve the performance of a system and eliminate bottlenecks. Therefore, when collecting metrics, always bear in mind the problem that needs solving or the system that we want to understand better, else the amount of metrics you could collect would become overwhelming! It’s a good idea to have a scenario in mind and then try to collect the appropriate metrics.

This tutorial will explain how to use Python 3 to collect metrics and enable Prometheus to pull and store them, using practical scenarios that include Linux System metrics, and metrics from the timing of database servers.

Prometheus has basic visualisation capabilities that are only useful for debugging purposes. As a result, there’s no point in keeping metrics in Prometheus or any other data storage if you’re not going to visualise them in another piece of software. In this tutorial we’ll visualise the metrics in Grafana, but feel free to use any visualisation software you’re comfortable with.

Docker-compose

For the purposes of this tutorial, we are going to use a docker-compose.yml file to run and use and . Later on, we’re going to add more Docker images,) shows the initial version docker-compose.yml – this version is for running and only because these are the essential parts of the process. The prometheus directory is where the configuration file (prometheus.yml) is stored.

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format1 min read
Video Stars
Italo Vignoli is one of the founders of LibreOffice and the Document Foundation. “LibreOffice 24.8 was announced in August, and at the same time the documentation team released the Getting Started Guide. This was the first time the manual was immedia
Linux Format2 min read
Mozilla Foundation Cuts Staff As Firefox Turns 20
THIS ISSUE: Firefox firings » Radical RADV boost » RISC-V enters Framework » Apple Maps travels to Linux » LXQt 2.1.0 let loose The Mozilla Foundation has opted to implement a number of cost-saving measures, including slashing around 30% of its workf
Linux Format1 min read
Subscribe!
UK readers turn to p16 2 GREAT WAYS TO SUBSCRIBE Print + NEW digital access or digital-only! » USA From $125.99 For 13 issues » REST OF THE WORLD From $125.99 For 13 issues » EUROPE From €110.99 For 13 issues IT’S EASY TO SUBSCRIBE! Visit www.magazin

Related