Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requirement to use X-Ray propagation for aws-sdk client calls #3212

Merged
merged 24 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
204e26e
Add requirement to use X-Ray propagation for aws-sdk client calls
tylerbenson Feb 15, 2023
f9cc5b3
Add CHANGELOG entry and allow additional propagators.
tylerbenson Feb 16, 2023
ad17d8e
Add tracestate as another example.
tylerbenson Feb 16, 2023
4c5a56a
Additional rewording per review
tylerbenson Feb 16, 2023
86f8ee7
Merge branch 'main' into tyler/aws-sdk
tylerbenson Feb 21, 2023
b135bad
Apply suggestions from code review
tylerbenson Feb 22, 2023
adf69dc
Restructure and reformat.
tylerbenson Feb 22, 2023
6cedce9
Merge branch 'main' into tyler/aws-sdk
tylerbenson Feb 23, 2023
319939b
Update specification/trace/semantic_conventions/instrumentation/aws-s…
tylerbenson Feb 24, 2023
71b8989
Update specification/trace/semantic_conventions/instrumentation/aws-s…
tylerbenson Mar 1, 2023
1969fa3
Move context propagation details to compatibility section
tylerbenson Mar 3, 2023
4f941f8
Merge branch 'main' into tyler/aws-sdk
tylerbenson Mar 13, 2023
0e5d72a
Merge branch 'main' into tyler/aws-sdk
tylerbenson Mar 16, 2023
032c31d
Merge branch 'main' into tyler/aws-sdk
tylerbenson Apr 6, 2023
e782303
Elaborate on a few items of concern from various reviews.
tylerbenson Apr 6, 2023
b7f62c6
Changes requested by the TC
tylerbenson Apr 19, 2023
a9cce94
Merge branch 'main' into tyler/aws-sdk
tylerbenson Apr 19, 2023
fcdc55d
Apply suggestions from code review
tylerbenson May 3, 2023
2238fa6
Apply suggestions from code review
tylerbenson May 3, 2023
370a70a
Fix spacing/line breaks
tylerbenson May 3, 2023
cfa65ea
Merge branch 'main' into tyler/aws-sdk
tylerbenson May 3, 2023
6df04a4
Fix changelog
tylerbenson May 3, 2023
4751960
Merge branch 'main' into tyler/aws-sdk
reyang May 9, 2023
e53e4b5
Merge branch 'main' into tyler/aws-sdk
reyang May 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ release.

### Compatibility

### Supplemenatary Guidelines

- Add guidance to use service-supported propagation formats as default for AWS SDK client calls.
([#3212](https://github.com/open-telemetry/opentelemetry-specification/pull/3212))

### OpenTelemetry Protocol

### SDK Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ For every message in the event, the [message system attributes][] (not message a
the user) SHOULD be checked for the key `AWSTraceHeader`. If it is present, an OpenTelemetry `Context` SHOULD be
parsed from the value of the attribute using the [AWS X-Ray Propagator](../../../context/api-propagators.md) and
added as a link to the span. This means the span may have as many links as messages in the batch.
See [compatibility](../../../../supplementary-guidelines/compatibility/aws.md#context-propagation) for more info.
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved

- [`faas.trigger`][faas] MUST be set to `pubsub`.
- [`messaging.operation`](../messaging.md) MUST be set to `process`.
Expand All @@ -122,6 +123,7 @@ corresponding to the SQS event. The [message system attributes][] (not message a
the user) SHOULD be checked for the key `AWSTraceHeader`. If it is present, an OpenTelemetry `Context` SHOULD be
parsed from the value of the attribute using the [AWS X-Ray Propagator](../../../context/api-propagators.md) and
added as a link to the span.
See [compatibility](../../../../supplementary-guidelines/compatibility/aws.md#context-propagation) for more info.
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved

- [`faas.trigger`][faas] MUST be set to `pubsub`.
- [`messaging.operation`](../messaging.md#messaging-attributes) MUST be set to `process`.
Expand Down
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ are found.

Some descriptions are also provided for populating general OpenTelemetry semantic conventions based on these APIs.

## Context Propagation

See [compatibility](../../../../supplementary-guidelines/compatibility/aws.md#context-propagation).

tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
## Common Attributes

The span name MUST be of the format `Service.Operation` as per the AWS HTTP API, e.g., `DynamoDB.GetItem`,
Expand Down
42 changes: 42 additions & 0 deletions supplementary-guidelines/compatibility/aws.md
tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Compatibility Considerations for AWS

This document highlights compatibility considerations for OpenTelemetry
instrumentations when interacting with AWS managed services using an aws-sdk,
a third-party library, or a direct HTTP request.

## Context Propagation

When making calls to AWS managed services using an AWS SDK, a third-party
library, or a direct HTTP request, an AWS service-supported propagation format should
be used to add context propagation to HTTP headers on the outgoing request in order
to propagate the context to services indirectly invoked by such call.

Instrumentation may allow a different propagator to be explicitly configured for
the instrumentation (e.g. an explicitly provided propagator, or an option to use the
globally configured propagator for all or certain calls).
This will be useful for certain cases where the services allow transporting these
headers to a receiving side, for example SQS or SNS with message attributes.
Note that this also means that instrumentations providing this option cannot just
replace their call to the X-Ray propagator with a call to another propagator (as
that would only send HTTP headers in the API REST call that would be immediately
ignored by the receiving AWS service), but will need to introduce per-service-call
implementations where it makes sense (e.g., for SQS send and SQS receive).
This can allow for transporting additional context that may not be supported by X-Ray,
such as baggage or tracestate, or supporting certain legacy propagation formats.
Documentation should advise that doing so is subject to attribute limits and billing impacts.

Propagation headers must be added before the signature is calculated to prevent
errors on signed requests. If injecting into the request itself (not just adding
additional HTTP headers), additional considerations may apply (for example, the
.NET AWS SDK calculates a hash of the attributes it sends and compares it with
the `MD5OfMessageAttributes` that it receives).

The following formats are currently natively supported by AWS services for propagation:

* [AWS X-Ray](https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html)

tylerbenson marked this conversation as resolved.
Show resolved Hide resolved
AWS service-supported context propagation is necessary to allow context propagation
through AWS managed services, for example: `S3 -> SNS -> SQS -> Lambda`.

(See the [aws-lambda sqs-event semantic convention](../../specification/trace/semantic_conventions/instrumentation/aws-lambda.md#sqs-event)
doc for details on how this context propagation is consumed by Lambda instrumentation.)