diff --git a/package.json b/package.json index ad0e87338c..4b14fb2426 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "author": "OpenTelemetry Authors", "license": "Apache-2.0", "devDependencies": { - "@commitlint/cli": "16.0.2", - "@commitlint/config-conventional": "16.0.0", + "@commitlint/cli": "18.4.1", + "@commitlint/config-conventional": "18.4.0", "@typescript-eslint/eslint-plugin": "5.8.1", "@typescript-eslint/parser": "5.8.1", "eslint": "8.7.0", diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts index 9652719e83..0ff16558f0 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/sns.ts @@ -42,6 +42,9 @@ export class SnsServiceExtension implements ServiceExtension { const { TopicArn, TargetArn, PhoneNumber } = request.commandInput; spanAttributes[SemanticAttributes.MESSAGING_DESTINATION] = this.extractDestinationName(TopicArn, TargetArn, PhoneNumber); + // ToDO: Use SpanAttributes.MESSAGING_DESTINATION_NAME when implemented + spanAttributes['messaging.destination.name'] = + TopicArn || TargetArn || PhoneNumber || 'unknown'; spanName = `${ PhoneNumber diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts index ce6ce9c885..36fa27e3d8 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/test/sns.test.ts @@ -84,6 +84,9 @@ describe('SNS - v2', () => { expect( publishSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION] ).toBe(topicName); + expect(publishSpan.attributes['messaging.destination.name']).toBe( + fakeARN + ); expect(publishSpan.attributes[SemanticAttributes.RPC_METHOD]).toBe( 'Publish' ); @@ -111,6 +114,9 @@ describe('SNS - v2', () => { expect( publishSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION] ).toBe(PhoneNumber); + expect(publishSpan.attributes['messaging.destination.name']).toBe( + PhoneNumber + ); }); it('inject context propagation', async () => { @@ -159,6 +165,9 @@ describe('SNS - v2', () => { expect( createTopicSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION] ).toBeUndefined(); + expect( + createTopicSpan.attributes['messaging.destination.name'] + ).toBeUndefined(); expect(createTopicSpan.kind).toBe(SpanKind.CLIENT); }); }); @@ -186,9 +195,11 @@ describe('SNS - v3', () => { describe('publish', () => { it('topic arn', async () => { const topicV3Name = 'dummy-sns-v3-topic'; + const topicV3ARN = `arn:aws:sns:us-east-1:000000000:${topicV3Name}`; + await sns.publish({ Message: 'sns message', - TopicArn: `arn:aws:sns:us-east-1:000000000:${topicV3Name}`, + TopicArn: topicV3ARN, }); const publishSpans = getTestSpans().filter( @@ -203,6 +214,9 @@ describe('SNS - v3', () => { expect( publishSpan.attributes[SemanticAttributes.MESSAGING_DESTINATION] ).toBe(topicV3Name); + expect(publishSpan.attributes['messaging.destination.name']).toBe( + topicV3ARN + ); expect(publishSpan.attributes[SemanticAttributes.RPC_METHOD]).toBe( 'Publish' ); diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts index 9e183fb2a9..04085fbe5d 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/utils.ts @@ -129,7 +129,7 @@ function createResolverSpan( }; const span = tracer.startSpan( - SpanNames.RESOLVE, + `${SpanNames.RESOLVE} ${attributes[AttributeNames.FIELD_PATH]}`, { attributes, }, diff --git a/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts b/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts index a9e379592d..d570a38e1a 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/test/graphql.test.ts @@ -613,7 +613,7 @@ describe('graphql', () => { await graphql({ schema: simpleSchemaWithResolver, source: '{ hello }' }); const resovleSpans = exporter .getFinishedSpans() - .filter(span => span.name === SpanNames.RESOLVE); + .filter(span => span.name === `${SpanNames.RESOLVE} hello`); assert.deepStrictEqual(resovleSpans.length, 1); const resolveSpan = resovleSpans[0]; assert(resolveSpan.attributes[AttributeNames.FIELD_PATH] === 'hello'); @@ -633,7 +633,7 @@ describe('graphql', () => { await graphql({ schema, source: '{ hello }', rootValue }); const resovleSpans = exporter .getFinishedSpans() - .filter(span => span.name === SpanNames.RESOLVE); + .filter(span => span.name === `${SpanNames.RESOLVE} hello`); assert.deepStrictEqual(resovleSpans.length, 1); const resolveSpan = resovleSpans[0]; assert(resolveSpan.attributes[AttributeNames.FIELD_PATH] === 'hello'); @@ -653,7 +653,7 @@ describe('graphql', () => { await graphql({ schema, source: '{ hello }', rootValue }); const resovleSpans = exporter .getFinishedSpans() - .filter(span => span.name === SpanNames.RESOLVE); + .filter(span => span.name === `${SpanNames.RESOLVE} hello`); assert.deepStrictEqual(resovleSpans.length, 0); }); @@ -682,7 +682,7 @@ describe('graphql', () => { await graphql({ schema, source: '{ hello }', rootValue, fieldResolver }); const resovleSpans = exporter .getFinishedSpans() - .filter(span => span.name === SpanNames.RESOLVE); + .filter(span => span.name === `${SpanNames.RESOLVE} hello`); assert.deepStrictEqual(resovleSpans.length, 1); const resolveSpan = resovleSpans[0]; assert(resolveSpan.attributes[AttributeNames.FIELD_PATH] === 'hello'); @@ -1355,7 +1355,9 @@ describe('graphql', () => { const spans = exporter.getFinishedSpans(); // single resolve span with error and event for exception - const resolveSpans = spans.filter(s => s.name === SpanNames.RESOLVE); + const resolveSpans = spans.filter( + s => s.name === `${SpanNames.RESOLVE} hello` + ); assert.deepStrictEqual(resolveSpans.length, 1); const resolveSpan = resolveSpans[0]; assert.deepStrictEqual(resolveSpan.status.code, SpanStatusCode.ERROR); diff --git a/plugins/node/opentelemetry-instrumentation-graphql/test/helper.ts b/plugins/node/opentelemetry-instrumentation-graphql/test/helper.ts index e7f564096b..56ebe30fda 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/test/helper.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/test/helper.ts @@ -28,7 +28,10 @@ export function assertResolveSpan( parentSpanId?: string ) { const attrs = span.attributes; - assert.deepStrictEqual(span.name, SpanNames.RESOLVE); + assert.deepStrictEqual( + span.name, + `${SpanNames.RESOLVE} ${attrs[AttributeNames.FIELD_PATH]}` + ); assert.deepStrictEqual(attrs[AttributeNames.FIELD_NAME], fieldName); assert.deepStrictEqual(attrs[AttributeNames.FIELD_PATH], fieldPath); assert.deepStrictEqual(attrs[AttributeNames.FIELD_TYPE], fieldType); diff --git a/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml index 88cc5e4c0e..b95dabc9ad 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml +++ b/plugins/node/opentelemetry-instrumentation-mysql/examples/docker/docker-compose.yaml @@ -59,7 +59,7 @@ services: # Grafana grafana: - image: grafana/grafana:9.0.1 + image: grafana/grafana:10.2.0 container_name: grafana volumes: - ./grafana/grafana.ini:/etc/grafana/grafana.ini