The agent instruments selected services in the aws-sdk 2.x package. AWS SDK for JavaScript v3 uses different packages and is not instrumented by these plugins.
Start the agent before loading aws-sdk:
const agent = require('skywalking-backend-js').default; agent.start(); const AWS = require('aws-sdk');
The plugins support normal AWS SDK v2 callbacks, request .send(callback), and request .promise() use.
The DynamoDB plugin instruments these AWS.DynamoDB.DocumentClient methods:
batchGet and batchWritedelete, get, put, and updatequery and scantransactGet and transactWriteIt creates database spans with operation names such as AWS/DynamoDB/put.
The Lambda plugin instruments AWS.Lambda.invoke. It does not trace requests whose InvocationType is DryRun.
Set SW_AWS_LAMBDA_CHAIN=true to add SkyWalking trace context to the invoke payload. The plugin may change a string or buffer payload into a JSON object so it can add the context. Enable this only when the called Lambda uses a SkyWalking Lambda wrapper and accepts this payload form.
export SW_AWS_LAMBDA_CHAIN=true
The wrapper removes the internal context before it calls your handler. See Serverless.
The SNS plugin instruments publish and publishBatch. For a publish to TopicArn, it adds an internal __revdTraceId message attribute. The SQS plugin can use that attribute to link an SNS to SQS message path.
The plugin does not add trace context when the SNS destination is only TargetArn or PhoneNumber.
The SQS plugin instruments:
sendMessagesendMessageBatchreceiveMessageSend operations add an internal __revdTraceId message attribute. Receive operations ask SQS for that attribute, use it as parent trace context, and remove the internal attribute before returning the message when possible.
The receive plugin removes MaxNumberOfMessages from the request. This makes SQS return at most one message so the agent can link one received message to one entry span. This changes batch receive behavior and can reduce receive throughput. Do not use this plugin when your application requires multi-message receives.
When SNS wraps message attributes inside the SQS body, set this option to also check the body:
export SW_AWS_SQS_CHECK_BODY=true
The four normal-loader disable values are:
AWS2DynamoDB
AWS2Lambda
AWS2SNS
AWS2SQS
For example:
export SW_AGENT_DISABLE_PLUGINS='AWS2SQS'
AWS SDK plugins do not have a dedicated current CI suite in this repository. Test their behavior with the exact AWS SDK v2 version and call form used by your service.