Repository navigation
docs: restrict access to the metrics endpoint, which API keys do not cover - #2448
Merged
Merged
Conversation
Contributor
✅ Pull with Spice PassedPassing checks:
|
Contributor
🔍 Pull with Spice FailedPassing checks:
Failed checks:
Please address these issues and update your pull request. |
Contributor
🔍 Pull with Spice FailedPassing checks:
Failed checks:
Please address these issues and update your pull request. |
Contributor
|
🚀 deployed to https://55f488b3.spiceai-org-website.pages.dev |
Contributor
There was a problem hiding this comment.
🟢 Approved
The documentation-only clarification of metrics access and authentication limitations has no active review issues.
No open issues 🎉
What changed in this PR
This documentation-only PR clarifies that API keys do not protect the separate Prometheus metrics listener and explains how to restrict network access. The guidance covers both trunk and version 2.4.x.
Changes:
- Corrects the metrics default: the endpoint is disabled unless
--metricsis configured. - Documents authentication and TLS limitations, with loopback binding and container/Kubernetes access guidance.
- Links authentication documentation to the new metrics access section.
| File | Description |
|---|---|
website/versioned_docs/version-2.4.x/features/observability/index.md |
Corrects defaults and adds metrics access guidance for 2.4.x. |
website/versioned_docs/version-2.4.x/api/auth/index.md |
Documents the metrics API-key exception and links to access guidance. |
website/docs/features/observability/index.md |
Corrects defaults and adds metrics access guidance for trunk. |
website/docs/api/auth/index.md |
Documents the metrics API-key exception and links to access guidance. |
Review effort: Balanced
Contributor
|
🚀 deployed to https://2b40c55a.spiceai-org-website.pages.dev |
This branch was successfully deployed
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.
What
Documents that the Prometheus metrics endpoint (
spiced --metrics) is not covered by API keys, and adds guidance to bind it to a loopback or private interface.features/observability: new Restrict Access to the Metrics Endpoint section. It says/metricschecks no API key and needs no client certificate under mTLS, that its labels include dataset names and HTTP route templates, and that TLS encrypts the connection without restricting who can scrape. It recommends--metrics 127.0.0.1:9090when the scraper is on the same host, and keeping the port off public load balancers and ingress, using a NetworkPolicy, in containers and Kubernetes. It also notes that the Helm chart binds0.0.0.0:9090.features/observability: corrects Default Configuration. The endpoint is disabled unless--metricsis set. It does not listen on9090by default.api/auth: one paragraph under HTTP, next to the existing/healthand/v1/readynote, saying API keys do not protect/metrics. It links to the new section.Applied to
docs/(trunk) andversioned_docs/version-2.4.x/, because v2.4.0 behaves the same way.Why
The auth page didn't mention
/metrics, and the TLS page only says it is "always accessible". A reader who enables API keys could reasonably assume the metrics listener is covered too. This is documentation of existing behavior, not a vulnerability. Whether to offer optional auth on/metricsis tracked separately.Verified against code (spiceai v2.4.0)
crates/runtime/src/metrics_server/mod.rs:start()binds its own listener and wraps it only in the runtime TLS acceptor.handle_http_request()serves/healthand/metricswith a rate limiter and no auth check.bin/spiced/src/lib.rs:--metricsisOption<SocketAddr>, documented as "disabled by default".deploy/chart/templates/deployment.yaml: the default command passes--metrics 0.0.0.0:9090.crates/runtime/src/http/routes.rs(track_metrics): thepathlabel is the axumMatchedPath, which is the route template.dataset_load_state{dataset=...}carries dataset names.No site build was run locally. The CI Deploy build passed (https://github.com/spiceai/docs/actions/runs/40736405684), and it runs with
onBrokenLinks,onBrokenAnchorsandonBrokenMarkdownLinksset tothrow, so the new links and anchors resolve.