Skip to content

Latest commit

 

History

159 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus

Deployment

  • terraform plan
  • terraform apply
  • Deploy dotnet app
  • Configure-Cloudflare-Records.ps1
  • Configure-Prometheus.ps1
  • Configure-AlertManager.ps1
  • Configure-Slack.ps1

URLs

Master node

Linux target

Windows target

App Service

Configure Alert Manager

Stress Tests Windows

  • choco install heavyload -y

Stress Tests Linux

  • sudo apt-get -y install stress-ng
  • stress-ng --vm-bytes $(awk '/MemFree/{printf "%d\n", $2 * 1;}' < /proc/meminfo)k --vm-keep -m 10
  • stress-ng --matrix 0
  • sudo apt-get -y install fio
  • fio --name=test --rw=write --bs=1M --iodepth=32 --filename=/tmp/test --size=20G

Configure Prometheus and Grafana

Notes

  • Linux default scrape port: 9100
  • Windows default scrape port: 9182
  • WinRM HTTP port: 5985
  • WinRM HTTPS port: 5986

Exporters GitHub

Grafana dashboards

Terraform provisioners

Docs

  • Daemon using outdated libraries fix: https://stackoverflow.com/q/73397110
    • /etc/needrestart/needrestart.conf
    • $nrconf{restart} = 'a';
    sudo curl -o /etc/needrestart/needrestart.conf https://raw.githubusercontent.com/kolosovpetro/prometheus-learning/refs/heads/master/needrestart.conf

Prometheus and Its Components

Prometheus is an open-source monitoring and alerting toolkit designed for recording real-time metrics in a time-series database. It supports flexible queries and provides robust alerting capabilities.

Key Components of Prometheus:

  1. Prometheus Server The core component responsible for collecting, storing, and querying time-series data. It pulls metrics from defined endpoints by scraping them at specified intervals.

  2. Service Discovery Automatically detects targets to scrape metrics from, reducing the need for manual configuration. This allows Prometheus to dynamically adapt to changes in infrastructure.

  3. Alert Manager Manages alerts generated by the Prometheus server, deduplicating and routing them to appropriate notification channels like email, Slack, or PagerDuty.

  4. Scheduler Handles the periodic task of scraping metrics from targets and storing them in the time-series database. It ensures consistent data collection.

  5. Web UI Provides a basic interface for exploring metrics and running queries directly in Prometheus. Users can visualize data and validate queries using PromQL.

  6. PromQL (Prometheus Query Language) A powerful query language used to retrieve and manipulate time-series data. It supports various functions for aggregating and analyzing metrics.

Prometheus diagram

Prometheus Architecture Diagram

About

Deploying Prometheus server on Linux using Bash and Terraform remote-exec provisioners. Set up Linux & Windows VMs as scrape targets, automate Prometheus Node Exporters via Azure Custom Script Extensions, PowerShell and Bash. Configure the Prometheus server using Bash and Terraform remote-exec provisioners.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages