Skip to content

Commit 198e7e1

Browse files
mhliddrochdev
authored andcommitted
Abstract the passing of extracted header span links to startSpan (#4918)
* updating span links * correcting field name * fixing links to _links
1 parent f60a37e commit 198e7e1

File tree

12 files changed

+13
-23
lines changed

12 files changed

+13
-23
lines changed

packages/datadog-plugin-amqplib/src/consumer.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class AmqplibConsumerPlugin extends ConsumerPlugin {
2626
'amqp.consumerTag': fields.consumerTag,
2727
'amqp.source': fields.source,
2828
'amqp.destination': fields.destination
29-
},
30-
extractedLinks: childOf?._links
29+
}
3130
})
3231

3332
if (

packages/datadog-plugin-aws-sdk/src/services/kinesis.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class Kinesis extends BaseAwsSdkPlugin {
4242
{},
4343
this.requestTags.get(request) || {},
4444
{ 'span.kind': 'server' }
45-
),
46-
extractedLinks: responseExtraction.maybeChildOf._links
45+
)
4746
}
4847
span = plugin.tracer.startSpan('aws.response', options)
4948
this.enter(span, store)

packages/datadog-plugin-aws-sdk/src/services/sqs.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class Sqs extends BaseAwsSdkPlugin {
3333
{},
3434
this.requestTags.get(request) || {},
3535
{ 'span.kind': 'server' }
36-
),
37-
extractedLinks: contextExtraction.datadogContext._links
36+
)
3837
}
3938
parsedMessageAttributes = contextExtraction.parsedAttributes
4039
span = plugin.tracer.startSpan('aws.response', options)

packages/datadog-plugin-google-cloud-pubsub/src/consumer.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ class GoogleCloudPubsubConsumerPlugin extends ConsumerPlugin {
2222
},
2323
metrics: {
2424
'pubsub.ack': 0
25-
},
26-
extractedLinks: childOf?._links
25+
}
2726
})
2827
if (this.config.dsmEnabled && message?.attributes) {
2928
const payloadSize = getMessageSize(message)

packages/datadog-plugin-grpc/src/server.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class GrpcServerPlugin extends ServerPlugin {
4848
},
4949
metrics: {
5050
'grpc.status.code': 0
51-
},
52-
extractedLinks: childOf?._links
51+
}
5352
})
5453

5554
addMetadataTags(span, metadata, metadataFilter, 'request')

packages/datadog-plugin-jest/src/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,7 @@ class JestPlugin extends CiPlugin {
219219
[COMPONENT]: this.constructor.id,
220220
...this.testEnvironmentMetadata,
221221
...testSuiteMetadata
222-
},
223-
extractedLinks: testSessionSpanContext?._links
222+
}
224223
})
225224
this.telemetry.ciVisEvent(TELEMETRY_EVENT_CREATED, 'suite')
226225
if (_ddTestCodeCoverageEnabled) {

packages/datadog-plugin-kafkajs/src/consumer.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ class KafkajsConsumerPlugin extends ConsumerPlugin {
7676
},
7777
metrics: {
7878
'kafka.partition': partition
79-
},
80-
extractedLinks: childOf?._links
79+
}
8180
})
8281
if (this.config.dsmEnabled && message?.headers) {
8382
const payloadSize = getMessageSize(message)

packages/datadog-plugin-moleculer/src/server.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class MoleculerServerPlugin extends ServerPlugin {
1818
meta: {
1919
'resource.name': action.name,
2020
...moleculerTags(broker, ctx, this.config)
21-
},
22-
extractedLinks: followsFrom?._links
21+
}
2322
})
2423
}
2524
}

packages/datadog-plugin-rhea/src/consumer.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ class RheaConsumerPlugin extends ConsumerPlugin {
2828
component: 'rhea',
2929
'amqp.link.source.address': name,
3030
'amqp.link.role': 'receiver'
31-
},
32-
extractedLinks: childOf?._links
31+
}
3332
})
3433

3534
if (

packages/datadog-plugin-vitest/src/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ class VitestPlugin extends CiPlugin {
191191
[COMPONENT]: this.constructor.id,
192192
...this.testEnvironmentMetadata,
193193
...testSuiteMetadata
194-
},
195-
extractedLinks: testSessionSpanContext?._links
194+
}
196195
})
197196
this.telemetry.ciVisEvent(TELEMETRY_EVENT_CREATED, 'suite')
198197
const store = storage.getStore()

packages/dd-trace/src/plugins/tracing.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class TracingPlugin extends Plugin {
101101
}
102102
}
103103

104-
startSpan (name, { childOf, kind, meta, metrics, service, resource, type, extractedLinks } = {}, enter = true) {
104+
startSpan (name, { childOf, kind, meta, metrics, service, resource, type } = {}, enter = true) {
105105
const store = storage.getStore()
106106
if (store && childOf === undefined) {
107107
childOf = store.span
@@ -119,7 +119,7 @@ class TracingPlugin extends Plugin {
119119
...metrics
120120
},
121121
integrationName: type,
122-
links: extractedLinks
122+
links: childOf?._links
123123
})
124124

125125
analyticsSampler.sample(span, this.config.measured)

packages/dd-trace/src/plugins/util/web.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ const web = {
267267
}
268268
}
269269

270-
const span = tracer.startSpan(name, { childOf, extractedLinks: childOf?.links })
270+
const span = tracer.startSpan(name, { childOf, links: childOf?._links })
271271

272272
return span
273273
},

0 commit comments

Comments
 (0)