Skip to content

Bound FastMCP tool metric cardinality - #442

Merged
lesnik512 merged 1 commit into
mainfrom
fix/fastmcp-metric-cardinality
Nov 4, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/fastmcp-metric-cardinality

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Unknown FastMCP tool names previously created permanent Prometheus series for every spelling. Resolve names before allocating metric children and omit unresolved calls from tool metrics. Registered, mounted, and transformed tools keep their labels and success/failure counts.

Preserve hashed app-tool metrics through FastMCP's hash resolver, using <hash>_<resolved tool name> as the label so proxy aliases share series. Document both behaviors in the configuration reference and 2.x migration guide.

Validation:

  • Failing public-client regression: 100 nonexistent names retained 2,000 samples before the fix and add none afterward; ordinary and hashed missing names are covered.
  • Public-client success/failure coverage for registered, mounted, transformed, and hashed tools. Another regression verifies 100 successful proxy aliases share retained samples.
  • FastMCP test file: 60 passed on both 4.0.0 and 4.1.5.
  • Full suite: 642 passed, 100% coverage.
  • Ruff lint, tracked-file formatting, EOF checks, type checking, and strict documentation build passed.
  • Standards and spec reviews: no remaining findings.

Closes #433.

@lesnik512
lesnik512 merged commit 2af92e0 into main Nov 4, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/fastmcp-metric-cardinality branch November 4, 2026 12:04
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.

[P1] Bound FastMCP metric labels for unknown tool names

1 participant