Skip to content

Commit

Permalink
Setup custom prometheus docker image that should be deployed to railway
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkavrba committed Oct 5, 2024
1 parent 975b80a commit 41d59d9
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.vscode
.fleet
dubs-bot.iml
37 changes: 37 additions & 0 deletions .github/workflows/build-prometheus-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Prometheus Docker image

on:
push:
paths:
- prometheus/**
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3
with:
install: true

- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
context: ./prometheus
tags: ghcr.io/jirkavrba/dubs-bot/prometheus:latest
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ services:
ports:
- "9090:9090"
volumes:
- "./docker/prometheus.yml:/etc/prometheus/prometheus.yml"
- "./prometheus/prometheus-local.yml:/etc/prometheus/prometheus.yml"
3 changes: 3 additions & 0 deletions prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM prom/prometheus:latest

COPY ./prometheus-railway.yml /etc/prometheus/prometheus.yml
File renamed without changes.
16 changes: 16 additions & 0 deletions prometheus/prometheus-railway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
scrape_configs:
- job_name: prometheus
honor_labels: true
static_configs:
- targets:
- "api.railway.internal"
scrape_interval: 30s
scrape_timeout: 5s
body_size_limit: 10MB
sample_limit: 1000
target_limit: 35
label_limit: 35
label_name_length_limit: 210
label_value_length_limit: 210
metrics_path: /prometheus
scheme: http

0 comments on commit 41d59d9

Please sign in to comment.