Skip to content

RPC #97

Open
Open

Description

@gggritso

RPC calls (including gRPC)

Activity

  1. linear commented on Jul 31, 2025

    @linear
  2. sentry-junior commented on May 29, 2026

    @sentry-junior
    Contributor

    Proposal: gRPC / RPC conventions based on cross-SDK review

    We recently did a cross-SDK review of all existing gRPC integrations (internal notes) and found significant divergence in span ops, attribute names, and span naming. Proposing we settle conventions here, using the Go SDK as the reference since it already aligns closely with OTel.

    Current state across SDKs

    SDK Status Span op Status code attr Origin Span name
    sentry-go Released (v0.46) rpc.client / rpc.server rpc.grpc.status_code (int) auto.rpc.grpc pkg.Service/Method
    sentry-python Released grpc.client / grpc.server rpc.response.status_code auto.grpc.grpc unary unary call to /pkg.Svc/Method
    sentry-dotnet Released (no tracing) — — — —
    sentry-javascript Released (GCP-only) grpc.{service} — auto.grpc.serverless —
    sentry-java Requested (#3265) — — — —
    sentry-dart Requested (#1120) — — — —

    Proposed conventions (OTel-aligned)

    Based on OTel RPC semantic conventions:

    Span attributes

    Attribute Value Notes
    rpc.system "grpc" Required
    rpc.service e.g. "pkg.Service" Service name component only
    rpc.method e.g. "Method" Method name component only
    rpc.grpc.status_code integer gRPC status code e.g. 0 for OK, 2 for Unknown

    Span op

    rpc.client for outgoing calls, rpc.server for incoming. The rpc.* namespace keeps it generic enough to cover other RPC systems in the future (Twirp, Connect, etc.).

    Span origin

    auto.rpc.grpc — category rpc, subsystem grpc.

    Span name

    pkg.Service/Method — stripped of leading slash, no call-type prefix. Matches OTel convention and is consistent with how gRPC itself formats method names.

    Trace propagation

    Inject/extract sentry-trace and baggage via gRPC metadata (the gRPC equivalent of HTTP headers).

    Method name parsing

    Full gRPC method strings have the format /pkg.Service/Method. Parse into:

    • rpc.service = pkg.Service
    • rpc.method = Method
    • Span name = pkg.Service/Method (strip leading slash only)

    Go reference: parseGRPCMethod

    Migration impact for existing SDKs

    • sentry-python: span op, origin, span name, and attribute keys all need updating. Changing span op is potentially breaking for dashboards/queries — needs migration strategy (dual-emit or major version).
    • sentry-javascript: GCP integration uses service-specific ops; minor scope, but should align if expanded.
    • sentry-dotnet: no tracing yet, so nothing to migrate — new implementation can start clean.

    Open questions for this issue to resolve

    1. Do we formally adopt OTel RPC semconv attributes or define our own?
    2. Should non-OK gRPC status codes always produce a Sentry error event, or only annotate the span? (Currently varies per SDK.)
    3. What streaming call types are required to claim gRPC support? (sentry-go covers all 4; sentry-python sync only covers unary-unary.)
    4. Do these conventions extend to other RPC systems (Twirp, Connect RPC, gRPC-web)?

    Go SDK is a good working reference — happy to pull its implementation into a formal spec here if that's the right format.

  3. lucas-zimerman commented on Jun 3, 2026

    @lucas-zimerman
    Collaborator

    Should we use rpc.grpc.* for anything related to grpc? that way we could group anything related to grpc, while following some bits from open telemetry
    If we do grpc.* we will end up with two data groups, the ones starting with rpc.* and another group as grpc.*

  4. cleptric commented on Jun 3, 2026

    @cleptric
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions