Skip to content

Commit

Permalink
Merge branch 'main' into graphql-ignore-resolvers
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk authored Dec 12, 2023
2 parents 3d38a51 + 60328af commit addac46
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ describe('instrumentation-aws-sdk-v3', () => {
);
});

it('sqs receive add messaging attributes and context', done => {
it('sqs receive add messaging attributes', done => {
nock(`https://sqs.${region}.amazonaws.com/`)
.matchHeader('content-type', 'application/x-www-form-urlencoded')
.post('/')
Expand Down Expand Up @@ -438,17 +438,45 @@ describe('instrumentation-aws-sdk-v3', () => {
'SQS'
);
expect(span.attributes[AttributeNames.AWS_REGION]).toEqual(region);
expect(span.attributes[SemanticAttributes.HTTP_STATUS_CODE]).toEqual(
200
);
done();
});
});

// Propagating span context to SQS ReceiveMessage promise handler is
// broken with `@aws-sdk/client-sqs` v3.316.0 and later.
// https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1477
it.skip('sqs receive context', done => {
nock(`https://sqs.${region}.amazonaws.com/`)
.matchHeader('content-type', 'application/x-www-form-urlencoded')
.post('/')
.reply(
200,
fs.readFileSync('./test/mock-responses/sqs-receive.xml', 'utf8')
);
nock(`https://sqs.${region}.amazonaws.com/`)
.matchHeader('content-type', 'application/x-amz-json-1.0')
.post('/')
.reply(
200,
fs.readFileSync('./test/mock-responses/sqs-receive.json', 'utf8')
);

const params = {
QueueUrl:
'https://sqs.us-east-1.amazonaws.com/731241200085/otel-demo-aws-sdk',
MaxNumberOfMessages: 3,
};
sqsClient.receiveMessage(params).then(res => {
const receiveCallbackSpan = trace.getSpan(context.active());
expect(receiveCallbackSpan).toBeDefined();
const attributes = (receiveCallbackSpan as unknown as ReadableSpan)
.attributes;
expect(attributes[SemanticAttributes.MESSAGING_OPERATION]).toMatch(
MessagingOperationValues.RECEIVE
);
expect(span.attributes[SemanticAttributes.HTTP_STATUS_CODE]).toEqual(
200
);
done();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
},
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"// @opentelemetry/instrumentation-bunyan": "TODO: change to a ver when there is a next release",
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/instrumentation-bunyan": "../",
"@opentelemetry/instrumentation-bunyan": "^0.34.0",
"@opentelemetry/resources": "^1.8.0",
"@opentelemetry/sdk-node": "^0.45.1",
"bunyan": "^1.8.15"
Expand Down

0 comments on commit addac46

Please sign in to comment.