Skip to content

Grafana Provisioning and Dashboard Integration - #52

Draft
R27-pixel wants to merge 3 commits into
p2poolv2:mainfrom
R27-pixel:feat/grafana-provisioning
Draft

R27-pixel wants to merge 3 commits into
p2poolv2:mainfrom
R27-pixel:feat/grafana-provisioning

Conversation

@R27-pixel

Copy link
Copy Markdown
Member

Summary

This PR adds Grafana provisioning support to PDM, allowing Grafana to automatically discover the Prometheus datasource and P2Poolv2 dashboards.

Changes

  • Generate Grafana datasource provisioning configuration pointing to the Prometheus instance.
  • Generate dashboard provider configuration.
  • Bundle the public P2Pool v2 dashboards:
    • pool.json
    • users.json
  • Exclude the private users dashboard.
  • Store generated provisioning files and dashboards under PDM's monitoring configuration directory.
  • Generate Grafana provisioning on startup when a valid P2Pool configuration is loaded.
  • Regenerate provisioning after successfully saving the P2Pool configuration.
  • Handle provisioning failures without preventing PDM startup or a successful configuration save.

Testing

  • Added unit tests for datasource and dashboard provider generation.
  • Verified dashboard JSON assets and filesystem output.
  • Verified provisioning failure handling.
  • Ran the complete test suite.
  • Manually tested Grafana provisioning and confirmed both dashboards load and display metrics.

Scope

This PR covers Grafana provisioning and dashboard integration only. Grafana and Prometheus service lifecycle management and monitoring UI controls are outside its scope.

@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.70085% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/prometheus.rs 94.37% 17 Missing ⚠️
src/grafana.rs 91.07% 10 Missing ⚠️
src/main.rs 97.66% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@R27-pixel
R27-pixel marked this pull request as draft November 17, 2026 12:52
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.

1 participant