Skip to content

Commit addac46

Browse files
authored
Merge branch 'main' into graphql-ignore-resolvers
2 parents 3d38a51 + 60328af commit addac46

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

plugins/node/opentelemetry-instrumentation-aws-sdk/test/aws-sdk-v3.test.ts

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ describe('instrumentation-aws-sdk-v3', () => {
402402
);
403403
});
404404

405-
it('sqs receive add messaging attributes and context', done => {
405+
it('sqs receive add messaging attributes', done => {
406406
nock(`https://sqs.${region}.amazonaws.com/`)
407407
.matchHeader('content-type', 'application/x-www-form-urlencoded')
408408
.post('/')
@@ -438,17 +438,45 @@ describe('instrumentation-aws-sdk-v3', () => {
438438
'SQS'
439439
);
440440
expect(span.attributes[AttributeNames.AWS_REGION]).toEqual(region);
441+
expect(span.attributes[SemanticAttributes.HTTP_STATUS_CODE]).toEqual(
442+
200
443+
);
444+
done();
445+
});
446+
});
447+
448+
// Propagating span context to SQS ReceiveMessage promise handler is
449+
// broken with `@aws-sdk/client-sqs` v3.316.0 and later.
450+
// https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1477
451+
it.skip('sqs receive context', done => {
452+
nock(`https://sqs.${region}.amazonaws.com/`)
453+
.matchHeader('content-type', 'application/x-www-form-urlencoded')
454+
.post('/')
455+
.reply(
456+
200,
457+
fs.readFileSync('./test/mock-responses/sqs-receive.xml', 'utf8')
458+
);
459+
nock(`https://sqs.${region}.amazonaws.com/`)
460+
.matchHeader('content-type', 'application/x-amz-json-1.0')
461+
.post('/')
462+
.reply(
463+
200,
464+
fs.readFileSync('./test/mock-responses/sqs-receive.json', 'utf8')
465+
);
441466

467+
const params = {
468+
QueueUrl:
469+
'https://sqs.us-east-1.amazonaws.com/731241200085/otel-demo-aws-sdk',
470+
MaxNumberOfMessages: 3,
471+
};
472+
sqsClient.receiveMessage(params).then(res => {
442473
const receiveCallbackSpan = trace.getSpan(context.active());
443474
expect(receiveCallbackSpan).toBeDefined();
444475
const attributes = (receiveCallbackSpan as unknown as ReadableSpan)
445476
.attributes;
446477
expect(attributes[SemanticAttributes.MESSAGING_OPERATION]).toMatch(
447478
MessagingOperationValues.RECEIVE
448479
);
449-
expect(span.attributes[SemanticAttributes.HTTP_STATUS_CODE]).toEqual(
450-
200
451-
);
452480
done();
453481
});
454482
});

plugins/node/opentelemetry-instrumentation-bunyan/examples/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
},
1616
"author": "OpenTelemetry Authors",
1717
"license": "Apache-2.0",
18-
"// @opentelemetry/instrumentation-bunyan": "TODO: change to a ver when there is a next release",
1918
"dependencies": {
2019
"@opentelemetry/api": "^1.3.0",
21-
"@opentelemetry/instrumentation-bunyan": "../",
20+
"@opentelemetry/instrumentation-bunyan": "^0.34.0",
2221
"@opentelemetry/resources": "^1.8.0",
2322
"@opentelemetry/sdk-node": "^0.45.1",
2423
"bunyan": "^1.8.15"

0 commit comments

Comments
 (0)