Fix protocol version tag for stateless server spans (#1810)
Co-authored-by: Luis Rodriguez <25299418+luisangelrod@users.noreply.github.com> Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
6fa3825973
commit
8754e19f80
1 changed files with 112 additions and 2 deletions
|
|
@ -962,9 +962,10 @@ internal sealed partial class McpSessionHandler : IAsyncDisposable
|
|||
tags.Add("network.protocol.name", "http");
|
||||
}
|
||||
|
||||
if (NegotiatedProtocolVersion is not null)
|
||||
string? protocolVersion = (message as JsonRpcRequest)?.Context?.ProtocolVersion ?? NegotiatedProtocolVersion;
|
||||
if (protocolVersion is not null)
|
||||
{
|
||||
tags.Add("mcp.protocol.version", NegotiatedProtocolVersion);
|
||||
tags.Add("mcp.protocol.version", protocolVersion);
|
||||
}
|
||||
|
||||
if (activity is { IsAllDataRequested: true })
|
||||
|
|
|
|||
Loading…
Reference in a new issue