Skip to content

[mcp] add server prometheus metrics#59773

Merged
greedy52 merged 6 commits intomasterfrom
STeve/56588_metrics
Oct 6, 2025
Merged

[mcp] add server prometheus metrics#59773
greedy52 merged 6 commits intomasterfrom
STeve/56588_metrics

Conversation

@greedy52
Copy link
Copy Markdown
Contributor

$ curl -s http://localhost:33001/metrics | grep mcp | grep -v '^#'
backend_requests{component="backend",range="false",req="/roles/mcp-user"} 2
teleport_alpn_proxy_active_connections{alpn="teleport-mcp-ping",source="listener"} 1
teleport_alpn_proxy_connections_total{alpn="teleport-mcp-ping",source="listener"} 3
teleport_mcp_active_sessions_total{transport="stdio"} 1
teleport_mcp_messages_from_client_total{method="initialize",transport="stdio",type="request"} 3
teleport_mcp_messages_from_client_total{method="notifications/initialized",transport="stdio",type="notification"} 2
teleport_mcp_messages_from_client_total{method="prompts/list",transport="stdio",type="request"} 2
teleport_mcp_messages_from_client_total{method="resources/list",transport="stdio",type="request"} 2
teleport_mcp_messages_from_client_total{method="tools/call",transport="stdio",type="request"} 1
teleport_mcp_messages_from_client_total{method="tools/list",transport="stdio",type="request"} 2
teleport_mcp_messages_from_server_total{method="initialize",transport="stdio",type="response"} 2
teleport_mcp_messages_from_server_total{method="notifications/message",transport="stdio",type="notification"} 17
teleport_mcp_messages_from_server_total{method="notifications/stderr",transport="stdio",type="notification"} 11
teleport_mcp_messages_from_server_total{method="prompts/list",transport="stdio",type="response"} 2
teleport_mcp_messages_from_server_total{method="resources/list",transport="stdio",type="response"} 2
teleport_mcp_messages_from_server_total{method="tools/call",transport="stdio",type="response"} 1
teleport_mcp_messages_from_server_total{method="tools/list",transport="stdio",type="response"} 2
teleport_mcp_sessions_total{transport="stdio"} 3

@greedy52 greedy52 added no-changelog Indicates that a PR does not require a changelog entry MCP MCP Server related labels Sep 30, 2025
Comment thread lib/srv/mcp/reporting.go
Comment thread lib/srv/mcp/reporting.go Outdated
Comment thread lib/srv/mcp/reporting.go
Comment thread lib/srv/mcp/reporting.go
@greedy52 greedy52 requested a review from bernardjkim October 3, 2025 15:58
Copy link
Copy Markdown
Contributor

@Tener Tener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to express test dependencies per my comment, but looks good otherwise.

Comment thread lib/srv/mcp/stdio_test.go Outdated
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from GavinFrazar October 3, 2025 18:19
@greedy52 greedy52 enabled auto-merge October 3, 2025 18:36
@greedy52 greedy52 force-pushed the STeve/56588_metrics branch from 4d804a8 to 7966e8b Compare October 3, 2025 19:04
@greedy52 greedy52 added this pull request to the merge queue Oct 6, 2025
Merged via the queue into master with commit 9be2746 Oct 6, 2025
40 of 41 checks passed
@greedy52 greedy52 deleted the STeve/56588_metrics branch October 6, 2025 15:19
greedy52 added a commit that referenced this pull request Oct 23, 2025
* [mcp] add server prometheus metrics

* remove TODO and nolint

* use counter where possible and limit known methods

* move reporting test to individual tests

* nolint for "cancelled"
github-merge-queue Bot pushed a commit that referenced this pull request Oct 27, 2025
* [MCP] server-side SSE support (#56051)

* MCP access part 12: server-side SSE support

* parse uri for determining transport type

* fix pointer, atomic, and parse error

� Conflicts:
�	lib/srv/mcp/server.go

* fix schema, etc

* switch to golang internal mcp sse parsing

* remove ParentCtx from logging

* fix build and address comments

* [mcp] refactor jwt token and app header rewrite logic (#58601)

* [mcp] mcputils for streamable http (#58764)

* [mcp] mcputils for streamable http

* fix flaky test

* use utils.ReadAtMost and fmt.Appendf

* add a marshal function for event

* fix spell

* [mcp] update audit events for streamable HTTP transport (#59155)

* [mcp] update audit events for streamable HTTP transport

* nolint for unused functions for now, they will be used in next PR

* [mcp] server handler for streamable HTTP transport (#59499)

* [mcp] server handler for streamable hTTP transport

* review comments round 1

* add comments and fix flaky test

* [mcp] bump mcp-go version (#59500)

* [mcp] bump mcp-go version

* fix IO transport by explicit start

* [mcp] add server prometheus metrics (#59773)

* [mcp] add server prometheus metrics

* remove TODO and nolint

* use counter where possible and limit known methods

* move reporting test to individual tests

* nolint for "cancelled"

* Fix an issue docker container launched by MCP commands are not removed sometimes (#59879)

* Fix an issue docker container launched by MCP commands are not removed sometimes

* switch to math/rand/v2

* add "tsh proxy mcp" command (#59968)

* [refactor] client.NewMCPServerDialer (#60020)

* [refactor] client.NewMCPServerDialer

* TestVerifyTLSCertLeafExpiry

* TestMatchResourcesByFilters

* fix typo

* fix lint

* mcputils for streamable HTTP transport conversion (#60024)

* mcputils for streamable HTTP transport conversion

* remove need of context from mcptest functions

* add test for notification

* [mcp] "tsh mcp connect" support for streamable HTTP (#60120)

* implement "tsh mcp connect" for streamable HTTP

* wait for 5s just to be conservative

* [mcp] Web UI and Teleport Connect adjustments for SSE and Streamable HTTP MCP servers (#60281)

* [mcp] Web UI and Teleport Connect adjustments for SSE and Streamable HTTP MCP servers

* review comments

* [mcp] fix some edge cases for streamable HTTP (#60286)

* [mcp] add JWT and rewrite headers support for SSE MCP servers (#60320)

* fix go.mod to match master

* fix lint and ut
rhammonds-teleport pushed a commit that referenced this pull request Nov 6, 2025
* [mcp] add server prometheus metrics

* remove TODO and nolint

* use counter where possible and limit known methods

* move reporting test to individual tests

* nolint for "cancelled"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MCP MCP Server related no-changelog Indicates that a PR does not require a changelog entry size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants