Part I: EC2 with Prometheus

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • prometheus

    The Prometheus monitoring system and time series database.

  • #cloud-config # environment: ${environment} runcmd: # install AWS CLI, neeeded for downloading of configuration files - | apt-get update && apt-get install unzip -y curl -Lo awscli.zip https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip unzip awscli.zip ./aws/install rm awscli.zip # install prometheus binary - | curl -Lo prometheus.tar.gz https://github.com/prometheus/prometheus/releases/download/v2.33.1/prometheus-2.33.1.linux-arm64.tar.gz tar -xvf prometheus.tar.gz cp ./prometheus-2.33.1.linux-arm64/prometheus /usr/local/bin/prometheus rm -rf ./prometheus-2.33.1.linux-arm64 rm -rf prometheus.tar.gz # install alertmanager binary - | curl -Lo alertmanager.tar.gz https://github.com/prometheus/alertmanager/releases/download/v0.23.0/alertmanager-0.23.0.linux-arm64.tar.gz tar -xvf alertmanager.tar.gz mv ./alertmanager-0.23.0.linux-arm64/alertmanager /usr/local/bin/alertmanager rm -rf alertmanager-0.23.0.linux-arm64 rm alertmanager.tar.gz # vait for EBS volume - | while [ ! -b $(readlink -f /dev/nvme1n1) ]; do echo "waiting for device /dev/nvme1n1" sleep 5 done # format volume blkid $(readlink -f /dev/nvme1n1) || mkfs -t ext4 $(readlink -f /dev/nvme1n1) # create a mount mkdir -p /data if ! grep "/dev/nvme1n1" /etc/fstab; then echo "/dev/nvme1n1 /data ext4 defaults,discard 0 0" >> /etc/fstab fi # mount volume mount /data # enable and start systemd services - | systemctl daemon-reload systemctl enable prepare-prometheus.service && systemctl start prepare-prometheus.service && sleep 10 systemctl enable prometheus.service && systemctl start prometheus.service systemctl enable alertmanager.service && systemctl start alertmanager.service write_files: - path: /usr/local/bin/prepare-prometheus permissions: '0744' content: | #!/bin/sh mkdir -p /etc/prometheus aws s3 cp s3://${s3_bucket}/prometheus.yaml /etc/prometheus/prometheus.yaml aws s3 cp s3://${s3_bucket}/alertmanager.yaml /etc/prometheus/alertmanager.yaml aws s3 cp s3://${s3_bucket}/prometheus.rules.yaml /etc/prometheus/prometheus.rules.yaml curl -X POST http://localhost:9090/-/reload || true - path: /etc/systemd/system/prepare-prometheus.service content: | [Unit] Description=Prepare prometheus / alertmanager configuration Wants=network-online.target After=network-online.target [Service] Type=oneshot ExecStart=/usr/local/bin/prepare-prometheus # please note data.mount in dependencies - path: /etc/systemd/system/prometheus.service content: | [Unit] Description=Prometheus Wants=network-online.target After=network-online.target data.mount prepare-prometheus.service [Service] Type=simple ExecStart=/usr/local/bin/prometheus \ --config.file /etc/prometheus/prometheus.yaml \ --storage.tsdb.path /data/ \ --web.enable-lifecycle \ --web.console.templates=/etc/prometheus/consoles \ --web.console.libraries=/etc/prometheus/console_libraries \ --enable-feature=remote-write-receiver [Install] WantedBy=multi-user.target - path: /etc/systemd/system/alertmanager.service content: | [Unit] Description=Alert Manager Wants=network-online.target After=network-online.target data.mount prepare-prometheus.service [Service] Type=simple ExecStart=/usr/local/bin/alertmanager \ --config.file /etc/prometheus/alertmanager.yaml \ --storage.path=/data/ [Install] WantedBy=multi-user.target

  • alertmanager

    Prometheus Alertmanager

  • #cloud-config # environment: ${environment} runcmd: # install AWS CLI, neeeded for downloading of configuration files - | apt-get update && apt-get install unzip -y curl -Lo awscli.zip https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip unzip awscli.zip ./aws/install rm awscli.zip # install prometheus binary - | curl -Lo prometheus.tar.gz https://github.com/prometheus/prometheus/releases/download/v2.33.1/prometheus-2.33.1.linux-arm64.tar.gz tar -xvf prometheus.tar.gz cp ./prometheus-2.33.1.linux-arm64/prometheus /usr/local/bin/prometheus rm -rf ./prometheus-2.33.1.linux-arm64 rm -rf prometheus.tar.gz # install alertmanager binary - | curl -Lo alertmanager.tar.gz https://github.com/prometheus/alertmanager/releases/download/v0.23.0/alertmanager-0.23.0.linux-arm64.tar.gz tar -xvf alertmanager.tar.gz mv ./alertmanager-0.23.0.linux-arm64/alertmanager /usr/local/bin/alertmanager rm -rf alertmanager-0.23.0.linux-arm64 rm alertmanager.tar.gz # vait for EBS volume - | while [ ! -b $(readlink -f /dev/nvme1n1) ]; do echo "waiting for device /dev/nvme1n1" sleep 5 done # format volume blkid $(readlink -f /dev/nvme1n1) || mkfs -t ext4 $(readlink -f /dev/nvme1n1) # create a mount mkdir -p /data if ! grep "/dev/nvme1n1" /etc/fstab; then echo "/dev/nvme1n1 /data ext4 defaults,discard 0 0" >> /etc/fstab fi # mount volume mount /data # enable and start systemd services - | systemctl daemon-reload systemctl enable prepare-prometheus.service && systemctl start prepare-prometheus.service && sleep 10 systemctl enable prometheus.service && systemctl start prometheus.service systemctl enable alertmanager.service && systemctl start alertmanager.service write_files: - path: /usr/local/bin/prepare-prometheus permissions: '0744' content: | #!/bin/sh mkdir -p /etc/prometheus aws s3 cp s3://${s3_bucket}/prometheus.yaml /etc/prometheus/prometheus.yaml aws s3 cp s3://${s3_bucket}/alertmanager.yaml /etc/prometheus/alertmanager.yaml aws s3 cp s3://${s3_bucket}/prometheus.rules.yaml /etc/prometheus/prometheus.rules.yaml curl -X POST http://localhost:9090/-/reload || true - path: /etc/systemd/system/prepare-prometheus.service content: | [Unit] Description=Prepare prometheus / alertmanager configuration Wants=network-online.target After=network-online.target [Service] Type=oneshot ExecStart=/usr/local/bin/prepare-prometheus # please note data.mount in dependencies - path: /etc/systemd/system/prometheus.service content: | [Unit] Description=Prometheus Wants=network-online.target After=network-online.target data.mount prepare-prometheus.service [Service] Type=simple ExecStart=/usr/local/bin/prometheus \ --config.file /etc/prometheus/prometheus.yaml \ --storage.tsdb.path /data/ \ --web.enable-lifecycle \ --web.console.templates=/etc/prometheus/consoles \ --web.console.libraries=/etc/prometheus/console_libraries \ --enable-feature=remote-write-receiver [Install] WantedBy=multi-user.target - path: /etc/systemd/system/alertmanager.service content: | [Unit] Description=Alert Manager Wants=network-online.target After=network-online.target data.mount prepare-prometheus.service [Service] Type=simple ExecStart=/usr/local/bin/alertmanager \ --config.file /etc/prometheus/alertmanager.yaml \ --storage.path=/data/ [Install] WantedBy=multi-user.target

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Tools for frontend monitoring with Prometheus

    6 projects | dev.to | 9 Apr 2024
  • Uptime monitoring (~1000 urls)

    7 projects | /r/selfhosted | 28 Nov 2022
  • Java Quarkus CQRS and EventSourcing microservice example 👋💫✨

    6 projects | dev.to | 23 May 2022
  • Grafana Mimir – 1B active series TSDB

    12 projects | news.ycombinator.com | 30 Mar 2022
  • How important is Observability for SRE?

    2 projects | dev.to | 11 Feb 2022