open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Instrument AWS SNS PublishBatch

Open
#19,835 1 comment 0 reactions 1 assignee View on GitHub

@trask is already working on this.

Since Aug 26, 2026.

enhancement needs triage
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

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

AWS SDK 2.2 instrumentation handles SNS PublishRequest but explicitly does not support PublishBatchRequest, which was introduced in AWS SDK 2.17.84. Batch publishes therefore do not receive SNS messaging propagation or per-message creation contexts.

Describe the solution you'd like

Add version-gated SNS PublishBatchRequest support using targeted muzzle-safe access to the newer API. Under stable messaging semantic conventions, emit one message-creation span for each eligible batch entry, inject its context into that entry, and make the batch send span link to every entry's creation context.

Use the common otel.instrumentation.messaging.batch-send.message-creation-spans.enabled setting to control the additional per-message spans. Preserve custom creation contexts already present on entries and cover supported and unsupported AWS SDK versions.

Describe alternatives you've considered

Inject the shared batch send context into every entry without creating per-message spans. This preserves propagation but gives every message in the batch the same creation context.

Additional context

SnsImpl documents the current limitation and points to the earlier muzzle discussion: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/SnsImpl.java

Related SQS implementation: #19485. Messaging semantic conventions recommend one Create span per message for batch-oriented APIs and a configuration option to disable them: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/#producer-spans

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.