Server uses deprecated rpc.response.status_code instead of rpc.status_code

Offen Anfängerfreundlich
#2,061 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
74/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
csharp
Bereich
observability

Rechercherichtung

Beginne damit, McpSessionHandler.AddExceptionTags und die Instrumentierungstests für Server-Spans und mcp.server.operation.duration zu finden. Prüfe, wo rpc.response.status_code auf jedes Signal angewendet wird, benenne den Tag anschließend in rpc.status_code um und führe die relevanten Tests aus. Fertig ist die Aufgabe, wenn sowohl die Spans als auch die Metrik denselben Schlüssel bereitstellen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug

Describe the bug
Spans and mcp.server.operation.duration are tagged with rpc.response.status_code (McpSessionHandler.AddExceptionTags). Semconv 1.45.0 renamed that to rpc.status_code, and the MCP conventions in the GenAI repo use the new name too.

To Reproduce

  1. Listen to the Experimental.ModelContextProtocol activity source and meter on the server.
  2. Send a request that fails with a JSON-RPC error, for example a method the server doesn't have.
  3. The span and the metric carry rpc.response.status_code.

Expected behavior
rpc.status_code. Since the source and meter are still "Experimental", maybe it can just be renamed?

Additional context
On spans we rename it in a processor, but a metric view can't rename a tag key, so the metric keeps the old name and doesn't line up with the spans.

Can open a PR if that works for you.

Vorherrschende Sprache
C#
Sterne
4.6k
Forks
855
Ø Merge
15 Std. 29 Min.
Gemergte PRs (30 T.)
8

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus modelcontextprotocol/csharp-sdk

Alle Issues in modelcontextprotocol/csharp-sdk

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.