Skip to content

fix: share FastMCP in-flight gauges across HTTP apps - #465

Merged
lesnik512 merged 1 commit into
mainfrom
fix/fastmcp-inflight-gauge
Nov 15, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/fastmcp-inflight-gauge

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Enabling the in-flight HTTP gauge caused a duplicate collector error when a second FastMCP HTTP app started. Apply the existing shared-gauge adapter to the default registry as well as custom registries. Upstream Instrumentator still creates a gauge per middleware instance and offers no collector-reuse hook.

Expand the regression to hold requests open in two simultaneous HTTP apps. Verify the shared count reaches 2, method and handler labels are preserved, separately configured gauges stay independent, and counts return to zero after completion.

Validation: regression failed before the fix; all 688 tests pass with 100% line coverage. Ruff and ty pass. Standards and spec reviews found no issues.

Closes #455.

@lesnik512
lesnik512 merged commit c3e5ae2 into main Nov 15, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/fastmcp-inflight-gauge branch November 15, 2026 11:33
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.

[P2] Avoid duplicate in-flight gauges across FastMCP HTTP apps

1 participant