Skip to content

Decide whether messaging receive telemetry should default on under stable semconv #19433

Description

@trask

Is your feature request related to a problem? Please describe.

The v1.43 messaging semconv migration has introduced an inconsistency in whether receive telemetry is emitted by default when the user hasn't configured it explicitly. Raised by @laurit in #19351 (comment).

In #19351, KafkaInstrumenterFactory and KafkaTelemetryBuilder now track whether the user configured receive instrumentation at all, and fall back to the semconv mode when they didn't:

private boolean receiveInstrumentationEnabled() {
  return messagingReceiveInstrumentationConfigured
      ? messagingReceiveInstrumentationEnabled
      : emitStableMessagingSemconv();
}

So under stable semconv, Kafka receive telemetry defaults on. The sibling AWS SQS PR #19350 does not do this — it only widens the span-links condition to emitStableMessagingSemconv() || messagingReceiveInstrumentationEnabled, leaving the receive default off. Two instrumentations in the same migration stack now behave differently on the same question.

Describe the solution you'd like

Pick one default and apply it consistently across all messaging instrumentations:

  1. Receive telemetry on by default under stable semconv. Stable semconv models receive as a first-class operation, and consumer-side context propagation is more legible with it. Costs an extra span per poll, including empty polls, which is why it was opt-in historically.
  2. Keep it off by default regardless of semconv mode, preserving today's behavior; users opt in explicitly. This is what Migrate AWS SQS messaging telemetry to v1.43 #19350 does.

Whichever we choose, the messaging-receive-telemetry config option and its docs should state the default per semconv mode, and the Kafka and AWS SDK paths should agree.

Describe alternatives you've considered

Leaving each instrumentation to decide. Rejected: the default is user-facing and cross-cutting, and silently differing per instrumentation is worse than either uniform choice.

Additional context

Affected so far: kafka-clients-common-0.11 (KafkaInstrumenterFactory), kafka-clients-2.6 (KafkaTelemetryBuilder), aws-sdk-1.11 / aws-sdk-2.2 SQS. The v1.43 stack is #19350#19351#19352 and onward through #19357, so settling this soon avoids relitigating it in each one.

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions