[PR #605] [MERGED] Fix Prometheus config mount: missing volume binding in docker-compose #4109

Closed
opened 2026-04-30 06:45:55 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Dokploy/templates/pull/605
Author: @Copilot
Created: 12/19/2025
Status: Merged
Merged: 12/19/2025
Merged by: @Siumauricio

Base: canaryHead: copilot/fix-prometheus-yml-configuration


📝 Commits (3)

  • a25e11d Initial plan
  • bbcc435 Fix Prometheus mounted prometheus.yml file by adding volume mount
  • 71d7330 Update blueprints/prometheus/template.toml

📊 Changes

2 files changed (+5 additions, -1 deletions)

View changed files

📝 blueprints/prometheus/docker-compose.yml (+1 -0)
📝 blueprints/prometheus/template.toml (+4 -1)

📄 Description

What is this PR about?

Fixes Prometheus template where prometheus.yml edits in Dokploy UI had no effect. The template.toml defined mount content but docker-compose.yml lacked the volume binding to inject it.

Changes

  • docker-compose.yml: Added ../files/prometheus.yml:/etc/prometheus/prometheus.yml volume mount
  • template.toml: Updated filePath from /etc/prometheus/prometheus.yml to prometheus.yml to match pattern used by garage-with-ui, plausible, libredesk templates

Pattern: Dokploy writes config.mounts content to ../files/{filePath}, docker-compose binds it into container.

Checklist

Before submitting this PR, please make sure that:

Screenshots or Videos

N/A - Configuration file changes only

Original prompt

This section details on the original issue you should resolve

<issue_title>Mounted Prometheus.yml file is not working</issue_title>
<issue_description>### Template Name

Prometheus

Relevant Logs of the Error

In Dokploy Volumes of the Prometheus template there is file prometheus.yml defined:

Image

However when looking into the configuration and also uncommenting parts of the file I noticed, that prometheus does not use the new configuration even after redeployments

mounted prometheus.yml

# Scrape configurations
scrape_configs:
  # Prometheus self-monitoring
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  # Example: Add your own targets here
  - job_name: 'node_exporter'
    static_configs:
      - targets: ['node-exporter:9100']

actual prometheus.yml

$ docker exec -it <prometheus-container> cat /etc/prometheus/prometheus.yml
# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: "prometheus"

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ["localhost:9090"]
       # The label name is added as a label `label_name=<label_value>` to any timeseries scraped from this config.
        labels:
          app: "prometheus"

Steps to Reproduce the Error

  1. Deploy the Prometheus Template
  2. Open Docker Terminal
  3. enter cat /etc/prometheus/prometheus.yml
  4. Copy or remember the file content
  5. Navigate to Advanced -> Volumes -> Edit Mount
  6. Compare file content in volumes with file content from before

Even more advanced:

  1. Uncomment any job in the mounted file
  2. Open Docker Terminal
  3. enter cat /etc/prometheus/prometheus.yml
  4. notice there are no changes to the contents of the file

Environment Information

Operating System: Ubuntu 24.04.3 LTS
Dokploy Version: v0.25.10
VPS Provider: Hetzner
Browser: Brave Browser

When does this error occur?

After successful deployment

Additional Context

  • I have not found any workaround

Will you send a PR to fix it?

Maybe, need help</issue_description>

Comments on the Issue (you are @copilot in this section)


Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Dokploy/templates/pull/605 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/19/2025 **Status:** ✅ Merged **Merged:** 12/19/2025 **Merged by:** [@Siumauricio](https://github.com/Siumauricio) **Base:** `canary` ← **Head:** `copilot/fix-prometheus-yml-configuration` --- ### 📝 Commits (3) - [`a25e11d`](https://github.com/Dokploy/templates/commit/a25e11ddb7a502d07317e6a72edb70647d883452) Initial plan - [`bbcc435`](https://github.com/Dokploy/templates/commit/bbcc435690beb584e758773d04595e19c4215646) Fix Prometheus mounted prometheus.yml file by adding volume mount - [`71d7330`](https://github.com/Dokploy/templates/commit/71d7330a3aff884a078077d1a354235d92e6c2d6) Update blueprints/prometheus/template.toml ### 📊 Changes **2 files changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `blueprints/prometheus/docker-compose.yml` (+1 -0) 📝 `blueprints/prometheus/template.toml` (+4 -1) </details> ### 📄 Description ## What is this PR about? Fixes Prometheus template where `prometheus.yml` edits in Dokploy UI had no effect. The `template.toml` defined mount content but `docker-compose.yml` lacked the volume binding to inject it. ## Changes - **docker-compose.yml**: Added `../files/prometheus.yml:/etc/prometheus/prometheus.yml` volume mount - **template.toml**: Updated `filePath` from `/etc/prometheus/prometheus.yml` to `prometheus.yml` to match pattern used by garage-with-ui, plausible, libredesk templates Pattern: Dokploy writes `config.mounts` content to `../files/{filePath}`, docker-compose binds it into container. ## Checklist Before submitting this PR, please make sure that: - [x] I have read the suggestions in the README.md file https://github.com/Dokploy/templates?tab=readme-ov-file#general-requirements-when-creating-a-template - [x] I have tested the template in my instance, so the maintainers don't spend time trying to figure out what's wrong. - [ ] I have added tests that demonstrate that my correction works or that my new feature works. ## Screenshots or Videos N/A - Configuration file changes only <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Mounted Prometheus.yml file is not working</issue_title> > <issue_description>### Template Name > > Prometheus > > ### Relevant Logs of the Error > > In Dokploy Volumes of the Prometheus template there is file `prometheus.yml` defined: > > <img width="1100" height="444" alt="Image" src="https://github.com/user-attachments/assets/a1a6260d-213f-4bd1-94f0-b6f3c4191a8d" /> > > However when looking into the configuration and also uncommenting parts of the file I noticed, that prometheus does not use the new configuration even after redeployments > > ### mounted prometheus.yml > ```sh > # Scrape configurations > scrape_configs: > # Prometheus self-monitoring > - job_name: 'prometheus' > static_configs: > - targets: ['localhost:9090'] > > # Example: Add your own targets here > - job_name: 'node_exporter' > static_configs: > - targets: ['node-exporter:9100'] > ``` > ### actual prometheus.yml > ```sh > $ docker exec -it <prometheus-container> cat /etc/prometheus/prometheus.yml > # my global config > global: > scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. > evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. > # scrape_timeout is set to the global default (10s). > > # Alertmanager configuration > alerting: > alertmanagers: > - static_configs: > - targets: > # - alertmanager:9093 > > # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. > rule_files: > # - "first_rules.yml" > # - "second_rules.yml" > > # A scrape configuration containing exactly one endpoint to scrape: > # Here it's Prometheus itself. > scrape_configs: > # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. > - job_name: "prometheus" > > # metrics_path defaults to '/metrics' > # scheme defaults to 'http'. > > static_configs: > - targets: ["localhost:9090"] > # The label name is added as a label `label_name=<label_value>` to any timeseries scraped from this config. > labels: > app: "prometheus" > ``` > > ### Steps to Reproduce the Error > > 1. Deploy the Prometheus Template > 2. Open Docker Terminal > 3. enter `cat /etc/prometheus/prometheus.yml` > 4. Copy or remember the file content > 5. Navigate to Advanced -> Volumes -> Edit Mount > 6. Compare file content in volumes with file content from before > > ### Even more advanced: > 1. Uncomment any job in the mounted file > 2. Open Docker Terminal > 3. enter `cat /etc/prometheus/prometheus.yml` > 4. notice there are no changes to the contents of the file > > ### Environment Information > > ```bash > Operating System: Ubuntu 24.04.3 LTS > Dokploy Version: v0.25.10 > VPS Provider: Hetzner > Browser: Brave Browser > ``` > > ### When does this error occur? > > After successful deployment > > ### Additional Context > > - I have not found any workaround > > ### Will you send a PR to fix it? > > Maybe, need help</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes Dokploy/templates#552 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/Dokploy/templates/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-30 06:45:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/templates#4109