Prometheus/OpenMetrics endpoint - #1415
Draft
DL6ER wants to merge 1 commit into
Draft
Conversation
1 task
✅ Deploy Preview for pihole-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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.
DL6ER
force-pushed
the
new/prometheus-metrics
branch
3 times, most recently
from
August 8, 2026 17:28
29b2050 to
e997e12
Compare
DL6ER
marked this pull request as draft
August 8, 2026 17:28
DL6ER
force-pushed
the
new/prometheus-metrics
branch
from
August 8, 2026 17:32
e997e12 to
fdc4d85
Compare
DL6ER
marked this pull request as ready for review
August 8, 2026 17:34
DL6ER
marked this pull request as draft
August 8, 2026 18:17
DL6ER
force-pushed
the
new/prometheus-metrics
branch
from
August 8, 2026 20:26
fdc4d85 to
9b4a51b
Compare
Signed-off-by: DL6ER <dl6er@dl6er.de>
DL6ER
force-pushed
the
new/prometheus-metrics
branch
from
August 9, 2026 04:46
9b4a51b to
631896b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
masterdirectly, so these pages must not go live before pi-hole/FTL#2943 ships.