Skip to content

Commit 972c734

Browse files
authored
Merge branch 'main' into tm-esm-testing-1
2 parents e0be467 + 99db4bb commit 972c734

File tree

7 files changed

+33
-11
lines changed

7 files changed

+33
-11
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"author": "OpenTelemetry Authors",
4545
"license": "Apache-2.0",
4646
"devDependencies": {
47-
"@commitlint/cli": "16.0.2",
48-
"@commitlint/config-conventional": "16.0.0",
47+
"@commitlint/cli": "18.4.1",
48+
"@commitlint/config-conventional": "18.4.0",
4949
"@typescript-eslint/eslint-plugin": "5.8.1",
5050
"@typescript-eslint/parser": "5.8.1",
5151
"eslint": "8.7.0",

plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export class SnsServiceExtension implements ServiceExtension {
4242
const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;
4343
spanAttributes[SemanticAttributes.MESSAGING_DESTINATION] =
4444
this.extractDestinationName(TopicArn, TargetArn, PhoneNumber);
45+
// ToDO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when implemented
46+
spanAttributes['messaging.destination.name'] =
47+
TopicArn || TargetArn || PhoneNumber || 'unknown';
4548

4649
spanName = `${
4750
PhoneNumber

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ describe('SNS - v2', () => {
8484
expect(
8585
publishSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION]
8686
).toBe(topicName);
87+
expect(publishSpan.attributes['messaging.destination.name']).toBe(
88+
fakeARN
89+
);
8790
expect(publishSpan.attributes[SemanticAttributes.RPC_METHOD]).toBe(
8891
'Publish'
8992
);
@@ -111,6 +114,9 @@ describe('SNS - v2', () => {
111114
expect(
112115
publishSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION]
113116
).toBe(PhoneNumber);
117+
expect(publishSpan.attributes['messaging.destination.name']).toBe(
118+
PhoneNumber
119+
);
114120
});
115121

116122
it('inject context propagation', async () => {
@@ -159,6 +165,9 @@ describe('SNS - v2', () => {
159165
expect(
160166
createTopicSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION]
161167
).toBeUndefined();
168+
expect(
169+
createTopicSpan.attributes['messaging.destination.name']
170+
).toBeUndefined();
162171
expect(createTopicSpan.kind).toBe(SpanKind.CLIENT);
163172
});
164173
});
@@ -186,9 +195,11 @@ describe('SNS - v3', () => {
186195
describe('publish', () => {
187196
it('topic arn', async () => {
188197
const topicV3Name = 'dummy-sns-v3-topic';
198+
const topicV3ARN = `arn:aws:sns:us-east-1:000000000:${topicV3Name}`;
199+
189200
await sns.publish({
190201
Message: 'sns message',
191-
TopicArn: `arn:aws:sns:us-east-1:000000000:${topicV3Name}`,
202+
TopicArn: topicV3ARN,
192203
});
193204

194205
const publishSpans = getTestSpans().filter(
@@ -203,6 +214,9 @@ describe('SNS - v3', () => {
203214
expect(
204215
publishSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION]
205216
).toBe(topicV3Name);
217+
expect(publishSpan.attributes['messaging.destination.name']).toBe(
218+
topicV3ARN
219+
);
206220
expect(publishSpan.attributes[SemanticAttributes.RPC_METHOD]).toBe(
207221
'Publish'
208222
);

plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function createResolverSpan(
129129
};
130130

131131
const span = tracer.startSpan(
132-
SpanNames.RESOLVE,
132+
`${SpanNames.RESOLVE} ${attributes[AttributeNames.FIELD_PATH]}`,
133133
{
134134
attributes,
135135
},

plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ describe('graphql', () => {
613613
await graphql({ schema: simpleSchemaWithResolver, source: '{ hello }' });
614614
const resovleSpans = exporter
615615
.getFinishedSpans()
616-
.filter(span => span.name === SpanNames.RESOLVE);
616+
.filter(span => span.name === `${SpanNames.RESOLVE} hello`);
617617
assert.deepStrictEqual(resovleSpans.length, 1);
618618
const resolveSpan = resovleSpans[0];
619619
assert(resolveSpan.attributes[AttributeNames.FIELD_PATH] === 'hello');
@@ -633,7 +633,7 @@ describe('graphql', () => {
633633
await graphql({ schema, source: '{ hello }', rootValue });
634634
const resovleSpans = exporter
635635
.getFinishedSpans()
636-
.filter(span => span.name === SpanNames.RESOLVE);
636+
.filter(span => span.name === `${SpanNames.RESOLVE} hello`);
637637
assert.deepStrictEqual(resovleSpans.length, 1);
638638
const resolveSpan = resovleSpans[0];
639639
assert(resolveSpan.attributes[AttributeNames.FIELD_PATH] === 'hello');
@@ -653,7 +653,7 @@ describe('graphql', () => {
653653
await graphql({ schema, source: '{ hello }', rootValue });
654654
const resovleSpans = exporter
655655
.getFinishedSpans()
656-
.filter(span => span.name === SpanNames.RESOLVE);
656+
.filter(span => span.name === `${SpanNames.RESOLVE} hello`);
657657
assert.deepStrictEqual(resovleSpans.length, 0);
658658
});
659659

@@ -682,7 +682,7 @@ describe('graphql', () => {
682682
await graphql({ schema, source: '{ hello }', rootValue, fieldResolver });
683683
const resovleSpans = exporter
684684
.getFinishedSpans()
685-
.filter(span => span.name === SpanNames.RESOLVE);
685+
.filter(span => span.name === `${SpanNames.RESOLVE} hello`);
686686
assert.deepStrictEqual(resovleSpans.length, 1);
687687
const resolveSpan = resovleSpans[0];
688688
assert(resolveSpan.attributes[AttributeNames.FIELD_PATH] === 'hello');
@@ -1355,7 +1355,9 @@ describe('graphql', () => {
13551355
const spans = exporter.getFinishedSpans();
13561356

13571357
// single resolve span with error and event for exception
1358-
const resolveSpans = spans.filter(s => s.name === SpanNames.RESOLVE);
1358+
const resolveSpans = spans.filter(
1359+
s => s.name === `${SpanNames.RESOLVE} hello`
1360+
);
13591361
assert.deepStrictEqual(resolveSpans.length, 1);
13601362
const resolveSpan = resolveSpans[0];
13611363
assert.deepStrictEqual(resolveSpan.status.code, SpanStatusCode.ERROR);

plugins/node/opentelemetry-instrumentation-graphql/test/helper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export function assertResolveSpan(
2828
parentSpanId?: string
2929
) {
3030
const attrs = span.attributes;
31-
assert.deepStrictEqual(span.name, SpanNames.RESOLVE);
31+
assert.deepStrictEqual(
32+
span.name,
33+
`${SpanNames.RESOLVE} ${attrs[AttributeNames.FIELD_PATH]}`
34+
);
3235
assert.deepStrictEqual(attrs[AttributeNames.FIELD_NAME], fieldName);
3336
assert.deepStrictEqual(attrs[AttributeNames.FIELD_PATH], fieldPath);
3437
assert.deepStrictEqual(attrs[AttributeNames.FIELD_TYPE], fieldType);

plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ services:
5959
# Grafana
6060

6161
grafana:
62-
image: grafana/grafana:9.0.1
62+
image: grafana/grafana:10.2.0
6363
container_name: grafana
6464
volumes:
6565
- ./grafana/grafana.ini:/etc/grafana/grafana.ini

0 commit comments

Comments
 (0)