You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/instrumentation-aws-sdk/README.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,6 @@ aws-sdk instrumentation has few options available to choose from. You can set th
53
53
|`preRequestHook`|`AwsSdkRequestCustomAttributeFunction`| Hook called before request send, which allow to add custom attributes to span. |
54
54
|`responseHook`|`AwsSdkResponseCustomAttributeFunction`| Hook for adding custom attributes when response is received from aws. |
55
55
|`exceptionHook`|`AwsSdkExceptionCustomAttributeFunction`| Hook for adding custom attributes when exception is received from aws. |
56
-
|`sqsProcessHook`|`AwsSdkSqsProcessCustomAttributeFunction`| Hook called after starting sqs `process` span (for each sqs received message), which allow to add custom attributes to it. |
57
56
|`suppressInternalInstrumentation`|`boolean`| Most aws operation use http requests under the hood. Set this to `true` to hide all underlying http spans. |
58
57
|`sqsExtractContextPropagationFromPayload`|`boolean`| Will parse and extract context propagation headers from SQS Payload, false by default. [When should it be used?](./doc/sns.md#integration-with-sqs)|
59
58
|`dynamoDBStatementSerializer`|`AwsSdkDynamoDBStatementSerializer`| AWS SDK instrumentation will serialize DynamoDB commands to the `db.statement` attribute using the specified function. Defaults to using a serializer that returns `undefined`. |
SQS is amazon's managed message queue. Thus, it should follow the [OpenTelemetry specification for Messaging systems](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md).
3
+
SQS is Amazon's managed message queue. Thus, it should follow the [OpenTelemetry specification for Messaging systems](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/).
4
4
5
5
## Specific trace semantic
6
6
7
7
The following methods are automatically enhanced:
8
8
9
9
### sendMessage / sendMessageBatch
10
10
11
-
-[Messaging Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes) are added by this instrumentation according to the spec.
11
+
-[Messaging Attributes](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/#messaging-attributes) are added by this instrumentation according to the spec.
12
12
- OpenTelemetry trace context is injected as SQS MessageAttributes, so the service receiving the message can link cascading spans to the trace which created the message.
13
13
14
14
### receiveMessage
15
15
16
-
-[Messaging Attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#messaging-attributes) are added by this instrumentation according to the spec.
17
-
- Additional "processing spans" are created for each message received by the application.
18
-
If an application invoked `receiveMessage`, and received a 10 messages batch, a single `messaging.operation` = `receive` span will be created for the `receiveMessage` operation, and 10 `messaging.operation` = `process` spans will be created, one for each message.
19
-
Those processing spans are created by the library. This behavior is partially implemented, [See discussion below](#processing-spans).
20
-
- Sets the inter process context correctly, so that additional spans created through the process will be linked to parent spans correctly.
21
-
This behavior is partially implemented, [See discussion below](#processing-spans).
16
+
-[Messaging Attributes](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/#messaging-attributes) are added by this instrumentation according to the spec.
17
+
- Sets the inter process context correctly, so that additional spans created through the process will be linked to parent spans correctly.
18
+
When multiple messages are received, the instrumentation will attach spank links to the receiving span containing the trace context and message ID of each message.
22
19
- Extract trace context from SQS MessageAttributes, and set span's `parent` and `links` correctly according to the spec.
23
-
24
-
#### Processing Spans
25
-
26
-
See GH issue [here](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/707)
27
-
28
-
According to OpenTelemetry specification (and to reasonable expectation for trace structure), user of this library would expect to see one span for the operation of receiving messages batch from SQS, and then, **for each message**, a span with it's own sub-tree for the processing of this specific message.
29
-
30
-
For example, if a `receiveMessages` returned 2 messages:
31
-
32
-
-`msg1` resulting in storing something to a DB.
33
-
-`msg2` resulting in calling an external HTTP endpoint.
34
-
35
-
This will result in a creating a DB span that would be the child of `msg1` process span, and an HTTP span that would be the child of `msg2` process span (in opposed to mixing all those operations under the single `receive` span, or start a new trace for each of them).
36
-
37
-
Unfortunately, this is not so easy to implement in JS:
38
-
39
-
1. The SDK is calling a single callback for the messages batch, and it's not straightforward to understand when each individual message processing starts and ends (and set the context correctly for cascading spans).
40
-
2. If async/await is used, context can be lost when returning data from async functions, for example:
Current implementation partially solves this issue by patching the `map` \ `forEach` \ `Filter` functions on the `Messages` array of `receiveMessage` result. This handles issues like the one above, but will not handle situations where the processing is done in other patterns (multiple map\forEach calls, index access to the array, other array operations, etc). This is currently an open issue in the instrumentation.
59
-
60
-
User can add custom attributes to the `process` span, by setting a function to `sqsProcessHook` in instrumentation config. For example:
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
29
+
*/
30
+
exportconstATTR_AWS_SECRETSMANAGER_SECRET_ARN=
31
+
'aws.secretsmanager.secret.arn'asconst;
32
+
33
+
/**
34
+
* The ARN of the AWS SNS Topic. An Amazon SNS [topic](https://docs.aws.amazon.com/sns/latest/dg/sns-create-topic.html) is a logical access point that acts as a communication channel.
* The number of messages sent, received, or processed in the scope of the batching operation.
163
+
*
164
+
* @example 0
165
+
* @example 1
166
+
* @example 2
167
+
*
168
+
* @note Instrumentations **SHOULD NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD NOT** use it for single-message APIs.
169
+
*
170
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
171
+
*/
172
+
exportconstATTR_MESSAGING_BATCH_MESSAGE_COUNT=
173
+
'messaging.batch.message_count'asconst;
174
+
175
+
/**
176
+
* The message destination name
177
+
*
178
+
* @example MyQueue
179
+
* @example MyTopic
180
+
*
181
+
* @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If
182
+
* the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker.
183
+
*
184
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
185
+
*/
186
+
exportconstATTR_MESSAGING_DESTINATION_NAME=
187
+
'messaging.destination.name'asconst;
188
+
189
+
/**
190
+
* A value used by the messaging system as an identifier for the message, represented as a string.
191
+
*
192
+
* @example "452a7c7c7c7048c2f887f61572b18fc2"
193
+
*
194
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
0 commit comments