Fix tool counter per-request creation, omitempty config, and streamable-http version#3761
Merged
ChrisJBurns merged 4 commits intomainfrom Feb 11, 2026
Merged
Conversation
- Fix SSE active connections gauge that was incremented but never decremented. Move increment into Handler with a defer decrement so the gauge correctly tracks SSE connection lifecycle. - Fix config file `use-legacy-attributes: false` being silently ignored. Change UseLegacyAttributes from bool to *bool in app config so nil (not set) is distinguishable from explicit false. Add two test cases covering both scenarios. - Log metric creation errors at debug level instead of silently discarding them. The OTEL SDK returns no-op instruments on error so there is no runtime risk, but logging aids troubleshooting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ng, and client span kind
- Add mcp.protocol.version span attribute by reading the
MCP-Protocol-Version header from streamable HTTP requests.
- Add mcp.client.operation.duration histogram metric to vMCP backend
client using the OTEL MCP semconv bucket boundaries, alongside the
existing toolhive_vmcp_backend_requests_duration custom metric.
- Include target name in span names per OTEL MCP semconv. Span names
now follow the "{method} {target}" format, e.g. "tools/call
github_search" instead of just "tools/call".
- Set SpanKindClient on vMCP backend call spans for proper distributed
trace linking.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…le-http version - B3: Remove omitempty from TracingEnabled/MetricsEnabled struct tags so YAML `false` values are not silently dropped during serialization - B6: Move tool call counter from per-request creation to struct initialization in NewHTTPMiddleware for consistency with other counters - B10: Return empty string for streamable-http protocol version in mapTransport since the actual backend version is unknown - T1: Add SSE dual emission test verifying recordSSEConnection emits both new and legacy span attributes based on UseLegacyAttributes flag Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rdimitrov
previously approved these changes
Feb 10, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3761 +/- ##
==========================================
+ Coverage 66.47% 66.49% +0.02%
==========================================
Files 428 428
Lines 42084 42087 +3
==========================================
+ Hits 27974 27987 +13
+ Misses 11979 11963 -16
- Partials 2131 2137 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
25145e3 to
250103c
Compare
JAORMX
approved these changes
Feb 11, 2026
JAORMX
approved these changes
Feb 11, 2026
11 tasks
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.
Summary
omitemptyfromTracingEnabled/MetricsEnabledstruct tags so YAMLfalsevalues are not silently dropped during serialization (same class of bug as fixed in Fix SSE gauge leak, config bool handling, and metric error logging #3756)toolhive_mcp_tool_callscounter from per-request creation to struct initialization inNewHTTPMiddleware, consistent with all other countersmapTransportsince the actual backend HTTP version is unknown (was hardcoded to"2")TestRecordSSEConnection_DualEmissiontest verifyingrecordSSEConnectionemits both new OTEL semconv and legacy span attributes based onUseLegacyAttributesflagParent issue: #3399
Test plan
task test— all telemetry and vMCP tests passtask lint— 0 issues🤖 Generated with Claude Code