The correction is integrated into the TP (See the green boxes)
What you will learn in this TP
- Install Pushgateway
- Access the Pushgateway console
- Send a script's metrics to Pushgateway
- Using the libraries
All steps and instructions are shown. Recommended for this lab: autonomous
Prerequisites #
Context. A batch job lasts a few seconds: Prometheus has no time to scrape it. You push its metrics to a Pushgateway.
Prerequisites: a machine with Docker and Docker Compose · Estimated time: 35 min
You must have a machine with Docker installed. If you don't have a machine or test environment, please complete the 'setting up the test environment' lab first.Pushgateway #
What you will learn in this section
- Install Pushgateway
- Access the Pushgateway console
▶ Review the concept presentation video
Deploy the container
You must deploy a Pushgateway container to collect metrics sent by ephemeral jobs (batches, etc.). Find an example docker-compose file with the configuration to deploy Pushgateway here: File.See the correction
Create a file with the configuration, e.g. docker-compose-pushgateway.yml, and put this configuration in it
Sending your metrics to Pushgateway #
What you will learn in this section
- Send a script's metrics to Pushgateway
- Using the libraries
▶ Review the concept presentation video
Create the script
We will create a simple Bash script called non_system_user.sh that lists the number of non-system users on the machine and sends it to Pushgateway.INFO: On Linux: - Non-system users have a UID (User ID) of 1000 or higher, except nobody (UID 65534). - Users are listed in /etc/passwd
See the correction
Here's an example script that does this
Pushgateway instrumentation
You must deploy a Node_exporter container to collect all of the machine's metrics. It must be added to the observability network.
See the correction
Here's an example script that does this
Verification
Run the script and check that the data shows up correctly in the Pushgateway console
See the correction
Just run the script:
then go to:sh non_system_user.shhttp://localhost:9091/metrics
Validate your work
Check that each goal above is reached and that you get the result described in the introduction.
Difficulty level : ●●●●○ (4/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Recent discussions about this course
- Prometheus consomme 12 Go de RAM : comment trouver les métriques coupables ?✓ solved · 2 reply(ies)
- PromQL : quelle différence entre rate() et irate() ?✓ solved · 1 reply(ies)
Ask a question about this lesson →See all discussions about this course
Course Glossary
Alerting
The process of notifying teams (via email, Slack, Teams) when a specific event, threshold breach, or anomaly is detected.
Architecture
The overall structural design of an IT system, defining its various components, their relationships, and the principles guiding its evolution.
OpenTelemetry
An open source framework providing standards, APIs, and SDKs to collect and export observability data (traces, metrics, logs) in an agnostic way.
Recommended Articles
Vector: sinks in detail (destinations, batches, buffers and retries)
Send Vector events: Loki, Elasticsearch, S3, Kafka, OpenTelemetry, Prometheus, Datadog, HTTP and ...
Grafana Alloy: collecting system metrics and local logs
Learn how to configure Grafana Alloy to monitor the server it runs on, with a focus on configurat...
Time-based vs event-based SLO: understanding, computing and choosing (with the Qonto example)
Differences between time-based SLOs (time slices, uptime) and event-based SLOs (good events over ...
The observability trilemma: cost, completeness and performance, and how solutions resolve it
Understanding the observability trilemma (cost, data completeness, query performance), its three ...
Ingesting metrics into VictoriaMetrics: scraping, vmagent and remote write
All the ways to feed VictoriaMetrics: remote write from Prometheus, built-in scraping, vmagent an...
Prometheus vs VictoriaMetrics: metrics scalability
Why choose VictoriaMetrics as an alternative to Prometheus for long-term storage and high perform...
Capstone project: the four signals of the OpenTelemetry Demo in the Grafana stack
A capstone project spanning the observability courses: deploy the OpenTelemetry Demo, send metric...
Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)
Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...
Grafana Alloy: The importance of Self-Monitoring
Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...