Skip to content

fix: quietly skip default Prometheus without client - #428

Merged
lesnik512 merged 1 commit into
mainfrom
fix/398-quiet-default-prometheus
Nov 4, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/398-quiet-default-prometheus

Conversation

@lesnik512

Copy link
Copy Markdown
Member

When prometheus_client is missing, the default metrics path now silently skips Prometheus as unconfigured. Custom paths still emit a missing-dependency warning. FastAPI also checks for prometheus_client alongside its instrumentator dependency.

Use each config's declared path default so FastStream stays opt-in and an explicitly configured FastStream path still warns. Document the defaults and the configured/skipped exception. An explicitly set /metrics on FastAPI, Litestar, or FastMCP remains indistinguishable from the default and skips silently without the client.

Closes #398.

Validation

  • Added the FastAPI default/custom-path regression first and verified both cases failed before the fix.
  • Updated FastMCP coverage for default-path silence and custom-path warnings.
  • just test-ci: 611 passed, 100% coverage.
  • just lint-ci: formatting, lint, and typechecking passed.
  • just docs-build: strict build passed.
  • Standards and spec reviews found no remaining issues.

@lesnik512
lesnik512 merged commit 2340ad4 into main Nov 4, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/398-quiet-default-prometheus branch November 4, 2026 09:40
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.

Don't warn about a missing Prometheus extra while the metrics path is still the default

1 participant