Repository navigation
Add MCP server monitoring metrics to the metrics reference lists #8508
Description
Activity
- added a commit that references this issue
on Aug 28, 2026 Hi Issac @IssacAX123
Suggested changes have been made to the MicroProfile Telemetry metrics reference list and JMX metrics reference list pages.
Draft Links:
Please review the changes and add the
Developer Reviewedlabel, if you are satisfied with the changes.Regards,
Ramkumar.Hi Ramkumar @ramkumar-k-9286
For https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/mptelemetry-metrics-list.html
can you remove the lineThis metric is also emitted when [MicroProfile Metrics 5.0](https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/mpMetrics-5.0.html) is enabled.in both rows for operation and sessionReacted by RamkumarHi Ramkumar @ramkumar-k-9286
Apologies, the names are wrong for the mbeans here is the updates
# MCP MXBean Attribute Name Corrections
see last comment belowHang on, that's not right.
I think the existing attribute names are right, but the name of the MBean itself is wrong.
@IssacAX123 the attribute names come from the
MXBeaninterfaces. EachgetFoomethod defines an attribute namedFoo.The MBean name on the other hand is created from
getAttributeMap()on the statistics object.So I think the list of attributes was correct, the part that needs to be changed is this bit:
The object name of the MXBean for these attributes is
WebSphere:type=McpSessionStatistics,name=*:Replace
WebSphere:type=McpOperationStatistics,name=*withWebSphere:type=McpOperationStatistics,name="mcpMethod:<mcpMethod>;genAiTool:<genAiTool>;errorType:<errorType>;genAiPrompt:<genAiPrompt>;rpcStatus:<rpcStatus>;genAiOp:<genAiOp>;jsonrpcVer:<jsonrpcVer>;mcpVer:<mcpVer>;netProto:<netProto>;netProtoVer:<netProtoVer>;netTransport:<netTransport>;resourceUri:<resourceUri>"Replace
WebSphere:type=McpSessionStatistics,name=*withWebSphere:type=McpSessionStatistics,name="session;errorType:<errorType>;jsonrpcVer:<jsonrpcVer>;mcpVer:<mcpVer>;netProto:<netProto>;netProtoVer:<netProtoVer>;netTransport:<netTransport>"Reacted by Ramkumar- added a commit that references this issue
on Aug 28, 2026 That's still not quite right, it should be:
WebSphere:type=McpOperationStatistics,mcpMethod=<mcpMethod>,genAiTool=<genAiTool>,errorType=<errorType>,genAiPrompt=<genAiPrompt>,rpcStatus=<rpcStatus>,genAiOp=<genAiOp>,jsonrpcVer=<jsonrpcVer>,mcpVer=<mcpVer>,netProto=<netProto>,netProtoVer=<netProtoVer>,netTransport=<netTransport>,resourceUri=<resourceUri>and
WebSphere:type=McpSessionStatistics,session=true,errorType=<errorType>,jsonrpcVer=<jsonrpcVer>,mcpVer=<mcpVer>,netProto=<netProto>,netProtoVer=<netProtoVer>,netTransport=<netTransport>@IssacAX123:
We made a change to no longer put all the attributes within anameattribute. The attribute map is turned into the name incom.ibm.websphere.monitor.meters.MeterCollection.MXBeanHelperWithAttributes(String, Map<String, String>, int, Object)Note:
Aside frommcpMethodandsession, all the parts of the name are optional and only included if the corresponding attribute is set.At the moment we never set
getAiPrompt,genAiOporresourceUriso they'll never actually appear in the name, but we may do in the future and the MXBean interface has corresponding methods.Reacted by Ramkumar- added a commit that references this issue
on Aug 28, 2026 Comments have been incorporated to the MicroProfile Telemetry metrics reference list and JMX metrics reference list pages.
Draft Links:
Please review the changes and add the
Developer Reviewedlabel, if you are satisfied with the changes.Regards,
Ramkumar.Published [26.0.0.9 release].
Add MCP server monitoring metrics to the metrics reference lists
Problem description
The
mcpServer-1.0feature ships monitoring support via three auto-features that activate automatically when paired with existing monitoring features:io.openliberty.mcpServer-1.0-monitor-1.0.featureJMX/MXBean support (viamonitor-1.0)io.openliberty.mcpServer-1.0-mpTelemetry-2.0.featureOpenTelemetry histograms (viampTelemetry-2.0)None of these metrics are documented in either:
mptelemetry-metrics-list.adocjmx-metrics-list.adocChanges needed
mptelemetry-metrics-list.adocAdd two rows to the MicroProfile Telemetry 2.0 and later metrics reference table:
mcp.server.operation.durationDoubleHistogram/ secondstools/call,tools/list,initialize,notifications/initialized,ping, andnotifications/cancelledrequest.MCPfeature:mcpServer-1.0andfeature:mpTelemetry-2.0[0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 30.0, 60.0, 120.0, 300.0]mcp.method.nametools/call,initialize,tools/list,pingrpc.response.status_codeokon success,erroron failurejsonrpc.protocol.version2.0network.protocol.nameHTTPnetwork.protocol.version1.1network.transporttcpmcp.protocol.versioninitialize2025-11-25gen_ai.tool.nametools/callonlyerror.typetool_error,internal_error,http_error, or a JSON-RPC error code such asINVALID_PARAMSmcp.server.session.durationDoubleHistogram/ secondsinitializeto session end. Only emitted in stateful mode.MCPfeature:mcpServer-1.0andfeature:mpTelemetry-2.0[0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 30.0, 60.0, 120.0, 300.0]jsonrpc.protocol.version2.0mcp.protocol.versioninitialize, e.g.2025-11-25network.protocol.nameHTTPnetwork.protocol.version1.1network.transporttcperror.typetimeout. Only present when the session did not close cleanlyFilter attribute update
Also update the
filterattribute example to includeMCPas a valid monitoring component value:Both metrics are also emitted via
mpMetrics-5.0with the same metric names.Changes needed
jmx-metrics-list.adocAdd a new MCP monitoring section. Both MXBeans activate automatically when
mcpServer-1.0andmonitor-1.0are both enabled. The monitoring component filter value isMCP. MXBean instances are created dynamically as operations and sessions are observed, and are removed when the associated application is unloaded.McpOperationStatisticsMXBeanObject name:
WebSphere:type=McpOperationStatistics,name=*McpMethodNametools/call,initialize,tools/list,ping. Always present.GenAiToolNametools/calldata points.GenAiPromptNameGenAiOperationNameErrorTypetool_error,internal_error,http_error, or a JSON-RPC error code such asINVALID_PARAMS.RpcResponseStatusCodeokon success,erroron failure.JsonrpcProtocolVersion2.0.McpProtocolVersion2025-11-25.NetworkProtocolNameHTTP.NetworkProtocolVersion1.1.NetworkTransporttcp.McpResourceUriCountCountDetailsDurationDurationDetailsMcpSessionStatisticsMXBeanObject name:
WebSphere:type=McpSessionStatistics,name=*ErrorTypeJsonrpcProtocolVersion2.0.McpProtocolVersioninitializee.g.2025-11-25.NetworkProtocolNameHTTP.NetworkProtocolVersion1.1.NetworkTransporttcp.CountCountDetailsDurationDurationDetails