Skip to content

add complete data persistence for Grafana and Prometheus#31

Merged
ozanunal0 merged 1 commit intomainfrom
dev
Jul 9, 2025
Merged

add complete data persistence for Grafana and Prometheus#31
ozanunal0 merged 1 commit intomainfrom
dev

Conversation

@ozanunal0
Copy link
Copy Markdown
Owner

  • Add persistent volumes for grafana_data and prometheus_data
  • Create Grafana provisioning configuration for automatic Prometheus datasource
  • Add dashboard provisioning setup with proper directory structure
  • Eliminate need to manually configure Grafana-Prometheus connection
  • Data now persists across container restarts (API keys, metrics, dashboards)
  • Grafana automatically connects to Prometheus on startup

Key files:

  • grafana/provisioning/datasources/prometheus.yml: Auto-configures Prometheus datasource
  • grafana/provisioning/dashboards/dashboard.yml: Dashboard provisioning config
  • Updated docker-compose.yml with persistent volumes and volume mounts

- Add persistent volumes for grafana_data and prometheus_data
- Create Grafana provisioning configuration for automatic Prometheus datasource
- Add dashboard provisioning setup with proper directory structure
- Eliminate need to manually configure Grafana-Prometheus connection
- Data now persists across container restarts (API keys, metrics, dashboards)
- Grafana automatically connects to Prometheus on startup

Key files:
- grafana/provisioning/datasources/prometheus.yml: Auto-configures Prometheus datasource
- grafana/provisioning/dashboards/dashboard.yml: Dashboard provisioning config
- Updated docker-compose.yml with persistent volumes and volume mounts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2025 15:13
@ozanunal0 ozanunal0 merged commit bdc9b48 into main Jul 9, 2025
6 of 12 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds persistent storage for Prometheus and Grafana and automates Grafana provisioning of the Prometheus datasource and dashboards.

  • Introduce Grafana datasource config for Prometheus
  • Add dashboard provisioning provider configuration
  • Update docker-compose.yml to mount persistent volumes and provisioning directories

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
grafana/provisioning/datasources/prometheus.yml Auto-configures Prometheus as a Grafana datasource
grafana/provisioning/dashboards/dashboard.yml Defines a dashboard provider pointing at the mounted dashboards
docker-compose.yml Adds prometheus_data volume and mounts provisioning paths
Comments suppressed due to low confidence (2)

docker-compose.yml:46

  • There is trailing whitespace at the end of this mount line, which can cause YAML parsing errors. Please remove the extra spaces.
      - ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards  

docker-compose.yml:47

  • Ensure that the ./grafana/dashboards directory exists in the repo and contains dashboard JSON files or placeholders; otherwise Grafana provisioning will find an empty directory.
      - ./grafana/dashboards:/var/lib/grafana/dashboards

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jul 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants