Skip to content

Prometheus/OpenMetrics endpoint - #1415

Draft
DL6ER wants to merge 1 commit into
masterfrom
new/prometheus-metrics
Draft

Prometheus/OpenMetrics endpoint#1415
DL6ER wants to merge 1 commit into
masterfrom
new/prometheus-metrics

Conversation

@DL6ER

@DL6ER DL6ER commented Aug 8, 2026

Copy link
Copy Markdown
Member

Documentation for pi-hole/FTL#2943, which adds a native Prometheus/OpenMetrics scrape endpoint at GET /api/metrics. This is the documentation PR @yubiuser asked for in pi-hole/FTL#2943 (comment).

To be merged with the release of v7.0 - docs.pi-hole.net serves master directly, so these pages must not go live before pi-hole/FTL#2943 ships.

@DL6ER
DL6ER requested a review from a team as a code owner August 8, 2026 16:57
Copilot AI lite review requested due to automatic review settings August 8, 2026 16:57
@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for pihole-docs ready!

Name Link
🔨 Latest commit 631896b
🔍 Latest deploy log https://app.netlify.com/projects/pihole-docs/deploys/6a78062d1beb34000801c5a8
😎 Deploy Preview https://deploy-preview-1415--pihole-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Pi-hole API documentation for the new native Prometheus/OpenMetrics scrape endpoint (GET /api/metrics) introduced in pi-hole/FTL#2943, and wires the new page into the MkDocs navigation.

Changes:

  • Add a new API documentation page describing enabling, authenticating, scraping, and configuring the Prometheus/OpenMetrics endpoint.
  • Add the new “Metrics” page to the MkDocs nav under “Pi-hole API”.

Reviewed changes

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

File Description
mkdocs.yml Adds the new “Metrics” page to the “Pi-hole API” navigation section.
docs/api/prometheus.md New documentation page for the Prometheus/OpenMetrics metrics endpoint, including auth model, config options, exported metrics, and example scrape config.
Suppressed comments (3)

docs/api/prometheus.md:120

  • Use "256-bit" (hyphenated compound modifier) here as well for consistency and correct grammar.
The response is identical for a missing and for an incorrect token, and tokens are compared in constant time. As the token is a 256 bit random value, no rate limiting is applied to this endpoint.

docs/api/prometheus.md:79

  • This curl example uses a concrete bearer token value. Prefer a placeholder (e.g., <scrape_token>) so readers don’t accidentally reuse the doc token and to avoid secret-scanning false positives in docs.
        curl -k "https://pi.hole/api/metrics" -H "Authorization: Bearer 7ua0rHPZixX6B3bTa5o4Dv08iyEIm/2q9qgLrF9MNVw="

docs/api/prometheus.md:88

  • This Python example hardcodes a concrete bearer token value. Prefer a placeholder (e.g., <scrape_token>) so readers don’t accidentally reuse the doc token and to avoid secret-scanning false positives in docs.
        headers = {"Authorization": "Bearer 7ua0rHPZixX6B3bTa5o4Dv08iyEIm/2q9qgLrF9MNVw="}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/api/prometheus.md Outdated
Comment thread docs/api/prometheus.md Outdated
Comment thread docs/api/prometheus.md
@DL6ER
DL6ER force-pushed the new/prometheus-metrics branch 3 times, most recently from 29b2050 to e997e12 Compare August 8, 2026 17:28
@DL6ER
DL6ER marked this pull request as draft August 8, 2026 17:28
@DL6ER
DL6ER force-pushed the new/prometheus-metrics branch from e997e12 to fdc4d85 Compare August 8, 2026 17:32
@DL6ER
DL6ER marked this pull request as ready for review August 8, 2026 17:34
@DL6ER
DL6ER marked this pull request as draft August 8, 2026 18:17
@DL6ER
DL6ER force-pushed the new/prometheus-metrics branch from fdc4d85 to 9b4a51b Compare August 8, 2026 20:26
Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER
DL6ER force-pushed the new/prometheus-metrics branch from 9b4a51b to 631896b Compare August 9, 2026 04:46
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