Skip to content

Fix FastMCP Prometheus registry handling and hashed-tool CI - #459

Merged
lesnik512 merged 2 commits into
mainfrom
fix/fastmcp-prometheus-registry
Nov 14, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
fix/fastmcp-prometheus-registry

Conversation

@lesnik512

@lesnik512 lesnik512 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Closes #451. Closes #460.

FastMCP HTTP metrics, tool metrics, and the scrape endpoint now use the configured Prometheus registry. The global registry remains the default. The optional in-progress gauge uses the configured registry and is shared across generated HTTP apps with matching gauge settings. The 2.x migration guide documents custom-registry scrapes.

The scheduled check exposed two test assumptions when FastMCP 4.2.0 added a __ prefix to hashed call names. Build aliases from FastMCP's call-name helper and assert the documented <hash>_<resolved tool name> metric label separately. Runtime metric labels and dependency requirements stay unchanged.

Verification with freshly upgraded dependencies on Python 3.14:

  • Reproduced Scheduled dependency check failed #460: 2 failed and 3 passed in the focused hashed-tool cases on FastMCP 4.2.0. The original cases passed on 4.1.6.
  • Corrected cases pass on both FastMCP 4.1.6 and 4.2.0: 5 passed each, including 100 proxy aliases sharing retained metric samples.
  • Combined changes: 669 tests passed with 100% line coverage. Ruff, ty, EOF checks, and the strict docs build passed.
  • Linux Python 3.11 FastMCP floor smoke passed with FastMCP 4.0.0, Instrumentator 8.0.1, and Sentry SDK 2.70.0.
  • Fresh PR CI passed on c6878eca53235d1e43e469ce2ae3b26cb01a12e6, including Python 3.11–3.15, both free-threaded entries, all 23 configured floor entries, isolated extra installs, lint, links, and docs.
  • Manual scheduled-workflow run passed on the same commit. This manual trigger also runs floors, which the daily scheduled trigger skips.
  • Security audit passed.

Current resolved dependency versions include FastMCP/fastmcp-slim 4.2.0, MCP 2.3.0, Starlette 1.10.0, Instrumentator 8.1.0, and Sentry SDK 2.75.0.

@lesnik512 lesnik512 changed the title Use the configured Prometheus registry in FastMCP Fix FastMCP Prometheus registry handling and hashed-tool CI Nov 14, 2026
@lesnik512
lesnik512 merged commit 9fdc698 into main Nov 14, 2026
70 checks passed
@lesnik512
lesnik512 deleted the fix/fastmcp-prometheus-registry branch November 14, 2026 15:07
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.

Scheduled dependency check failed [P2] Scrape FastMCP metrics from the configured Prometheus registry

1 participant