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
{{ message }}
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
This module provides automatic instrumentation for [`aws-sdk`](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/).
4
+
This module provides automatic instrumentation for [`aws-sdk` v2](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/) and [`@aws-sdk` v3](https://github.com/aws/aws-sdk-js-v3)
5
5
6
6
## Installation
7
7
@@ -49,32 +49,36 @@ aws-sdk instrumentation has few options available to choose from. You can set th
49
49
50
50
51
51
## Span Attributes
52
-
This instrumentation patch the internal `Request` object, which means that each sdk operation will create a single span with attributes from 3 sources:
52
+
Both V2 and V3 instrumentations are collecting the following attributes:
53
+
| Attribute Name | Type | Description | Example |
54
+
| -------------- | ---- | ----------- | ------- |
55
+
|`rpc.system`| string | Always equals "aws-api" |
56
+
|`rpc.method`| string | The name of the operation corresponding to the request, normalized to camelCase |`putObject`|
57
+
|`rpc.service`| string | The name of the service to which a request is made, as returned by the AWS SDK, normalized to lower case |`s3`|
58
+
|`aws.region`| string | Region name for the request | "eu-west-1" |
53
59
54
-
### Default attributes
55
-
Each span will have the following attributes:
60
+
### V2 attributes
61
+
In addition to the above attributes, the instrumentation also collect the following for V2 ONLY:
|`aws.operation`| string | The method name for the request. | for `SQS.sendMessage(...)` the operation is "sendMessage" |
60
65
|`aws.signature.version`| string | AWS version of authentication signature on the request. | "v4" |
61
-
|`aws.region`| string | Region name for the request | "eu-west-1" |
62
66
|`aws.service.api`| string | The sdk class name for the service | "SQS" |
63
67
|`aws.service.identifier`| string | Identifier for the service in the sdk | "sqs" |
64
68
|`aws.service.name`| string | Abbreviation name for the service | "Amazon SQS" |
65
69
|`aws.request.id`| uuid | Request unique id, as returned from aws on response | "01234567-89ab-cdef-0123-456789abcdef" |
66
70
|`aws.error`| string | information about a service or networking error, as returned from AWS | "UriParameterError: Expected uri parameter to have length >= 1, but found "" for params.Bucket" |
67
71
68
72
### Custom User Attributes
69
-
The instrumentation user can configure a `preRequestHook` function which will be called before each request, with the request object and the corresponding span.
73
+
The instrumentation user can configure a `preRequestHook` function which will be called before each request, with a normalized request object (across v2 and v3) and the corresponding span.
70
74
This hook can be used to add custom attributes to the span with any logic.
71
75
For example, user can add interesting attributes from the `request.params`, and write custom logic based on the service and operation.
0 commit comments