Skip to content

[Feature]: otelgrpc — capture server.address and server.port for failed RPC client spans #8781

@cyrille-leclerc

Description

@cyrille-leclerc

Component

Instrumentation: otelgrpc

Problem Statement

RPC client spans generated for gRPC calls that fail due to an invalid hostname are missing the server.address and server.port attributes.

These attributes are:

  • Essential for effective troubleshooting
  • Defined as “Conditionally Required If available” in the OpenTelemetry Semantic Conventions (reference)

See problem on the OTel Demo when activating the paymentUnreachable feature flag ( http://localhost:8080/feature ) as preported by @bpschmitt in open-telemetry/opentelemetry-demo#3203:

image

Proposed Solution

Add server.address and server.port for failed RPC client spans.

The source code seems to relate to the error handling part of:

if rs.Error != nil {
s, _ = status.FromError(rs.Error)
rpcStatusAttr = semconv.RPCResponseStatusCode(canonicalString(s.Code()))

Alternatives

No response

Prior Art

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions