Skip to content

Add Prometheus Workload. #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compose/DEV.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ DATA_LAKE_HADOOP_VERSION=2.10.1
DATA_LAKE_KAFKA_VERSION=3.2.1
DATA_LAKE_HADOOP_NETWORK=14.1.3.0/24
DATA_LAKE_KAFKA_NETWORK=14.1.4.0/24


PROMETHEUS_VERSION=2.53.1
PROMETHEUS_IP=15.1.1.50
PROMETHEUS_NETWORK=15.1.0.0/16
PROMETHEUS_PORT=8080
29 changes: 29 additions & 0 deletions compose/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.8'
services:
prometheus:
image: sloopstash/prometheus:v2.53.1
entrypoint: /usr/bin/supervisord
command: "-c /etc/supervisord.conf"
ports:
- "${PROMETHEUS_PORT}:9090"
volumes:
- prometheus-data:/opt/prometheus/data
- prometheus-log:/opt/prometheus/log
- ${HOME_DIR}/workload/supervisor/conf/server.conf:/etc/supervisord.conf
- ${HOME_DIR}/workload/prometheus/${PROMETHEUS_VERSION}/conf/supervisor.ini:/opt/prometheus/system/supervisor.ini
- ${HOME_DIR}/workload/prometheus/${PROMETHEUS_VERSION}/conf/prometheus.yml:/opt/prometheus/conf/prometheus.yml
networks:
common:
ipv4_address: ${PROMETHEUS_IP}
volumes:
prometheus-data:
driver: local
prometheus-log:
driver: local
networks:
common:
driver: bridge
ipam:
driver: default
config:
- subnet: ${PROMETHEUS_NETWORK}
4 changes: 4 additions & 0 deletions image/prometheus/2.53.1/context/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory.
*
# Except this file.
!.gitignore
36 changes: 36 additions & 0 deletions image/prometheus/2.53.1/prometheus.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Docker image to use
From sloopstash/base:v1.1.1

# Download and extract Prometheus
WORKDIR /tmp
RUN set -x \
&& wget https://github.com/prometheus/prometheus/releases/download/v2.53.1/prometheus-2.53.1.linux-amd64.tar.gz --quiet \
&& tar -xvzf prometheus-2.53.1.linux-amd64.tar.gz > /dev/null

# Compile and install Prometheus
WORKDIR prometheus-2.53.1.linux-amd64
RUN set -x \
&& cp prometheus /usr/local/bin/ \
&& cp promtool /usr/local/bin/

# Create Prometheus directories.
RUN set -x \
&& mkdir /opt/prometheus \
&& mkdir /opt/prometheus/data \
&& mkdir /opt/prometheus/log \
&& mkdir /opt/prometheus/conf \
&& mkdir /opt/prometheus/script \
&& mkdir /opt/prometheus/system \
&& mkdir /opt/prometheus/console_libraries \
&& mkdir /opt/prometheus/consoles \
&& touch /opt/prometheus/system/server.pid \
&& touch /opt/prometheus/system/supervisor.ini \
&& ln -s /opt/prometheus/system/supervisor.ini /etc/supervisord.d/prometheus.ini \
&& cp -r consoles/* /opt/prometheus/consoles \
&& cp -r console_libraries/* /opt/prometheus/console_libraries \
&& cd ../ \
&& rm -rf prometheus-2.53.1.linux* \
&& history -c

# Set default work directory.
WORKDIR /opt/prometheus
9 changes: 9 additions & 0 deletions workload/prometheus/2.53.1/conf/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
global:
scrape_interval: 15s
evaluation_interval: 15s
query_log_file: /opt/prometheus/log/query.log

scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
5 changes: 5 additions & 0 deletions workload/prometheus/2.53.1/conf/supervisor.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[program:prometheus]
command=bash -c "prometheus --config.file=/opt/prometheus/conf/prometheus.yml --storage.tsdb.path=/opt/prometheus/data --web.console.templates=/opt/prometheus/consoles --web.console.libraries=/opt/prometheus/console_libraries"
process_name=%(program_name)s
pidfile=/opt/prometheus/system/server.pid
autorestart=false