dd-trace 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-3rdparty.csv +0 -1
- package/ext/formats.js +3 -5
- package/package.json +4 -5
- package/packages/datadog-instrumentations/index.js +1 -52
- package/packages/datadog-instrumentations/src/connect.js +5 -5
- package/packages/datadog-instrumentations/src/fastify.js +12 -25
- package/packages/datadog-instrumentations/src/helpers/hooks.js +68 -0
- package/packages/datadog-instrumentations/src/helpers/instrument.js +5 -34
- package/packages/datadog-instrumentations/src/helpers/instrumentations.js +3 -0
- package/packages/datadog-instrumentations/src/helpers/register.js +59 -0
- package/packages/datadog-instrumentations/src/koa.js +5 -5
- package/packages/datadog-instrumentations/src/mocha.js +4 -1
- package/packages/datadog-instrumentations/src/restify.js +27 -5
- package/packages/datadog-instrumentations/src/router.js +5 -5
- package/packages/datadog-plugin-aws-sdk/src/base.js +1 -2
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +1 -2
- package/packages/datadog-plugin-mocha/src/index.js +2 -2
- package/packages/datadog-plugin-restify/src/index.js +7 -0
- package/packages/datadog-plugin-router/src/index.js +13 -8
- package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +220 -0
- package/packages/dd-trace/src/config.js +6 -0
- package/packages/dd-trace/src/encode/0.4.js +4 -0
- package/packages/dd-trace/src/{profiling/exporters → exporters/common}/form-data.js +0 -0
- package/packages/dd-trace/src/exporters/common/request.js +49 -34
- package/packages/dd-trace/src/exporters/common/writer.js +8 -1
- package/packages/dd-trace/src/id.js +16 -13
- package/packages/dd-trace/src/noop/span.js +12 -12
- package/packages/dd-trace/src/noop/tracer.js +8 -5
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +6 -6
- package/packages/dd-trace/src/opentracing/span.js +63 -49
- package/packages/dd-trace/src/opentracing/span_context.js +1 -5
- package/packages/dd-trace/src/opentracing/tracer.js +31 -36
- package/packages/dd-trace/src/plugin_manager.js +95 -65
- package/packages/dd-trace/src/plugins/index.js +57 -45
- package/packages/dd-trace/src/plugins/util/ci.js +34 -9
- package/packages/dd-trace/src/plugins/util/git.js +52 -2
- package/packages/dd-trace/src/plugins/util/tags.js +4 -1
- package/packages/dd-trace/src/plugins/util/web.js +5 -2
- package/packages/dd-trace/src/profiling/exporters/agent.js +1 -1
- package/packages/dd-trace/src/profiling/profilers/cpu.js +3 -3
- package/packages/dd-trace/src/proxy.js +16 -12
- package/packages/dd-trace/src/startup-log.js +8 -19
- package/packages/dd-trace/src/telemetry.js +1 -14
- package/scripts/install_plugin_modules.js +17 -26
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
// TODO (new internal tracer): use DC events for lifecycle metrics and test them
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const now = require('performance-now')
|
|
4
|
+
const now = require('perf_hooks').performance.now
|
|
5
|
+
const dateNow = Date.now
|
|
7
6
|
const semver = require('semver')
|
|
8
|
-
const Span = opentracing.Span
|
|
9
7
|
const SpanContext = require('./span_context')
|
|
10
8
|
const id = require('../id')
|
|
11
9
|
const tagger = require('../tagger')
|
|
@@ -21,10 +19,8 @@ const {
|
|
|
21
19
|
const unfinishedRegistry = createRegistry('unfinished')
|
|
22
20
|
const finishedRegistry = createRegistry('finished')
|
|
23
21
|
|
|
24
|
-
class DatadogSpan
|
|
22
|
+
class DatadogSpan {
|
|
25
23
|
constructor (tracer, processor, prioritySampler, fields, debug) {
|
|
26
|
-
super()
|
|
27
|
-
|
|
28
24
|
const operationName = fields.operationName
|
|
29
25
|
const parent = fields.parent || null
|
|
30
26
|
const tags = Object.assign({}, fields.tags)
|
|
@@ -70,66 +66,45 @@ class DatadogSpan extends Span {
|
|
|
70
66
|
return `Span${json}`
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
let spanContext
|
|
75
|
-
|
|
76
|
-
if (parent) {
|
|
77
|
-
spanContext = new SpanContext({
|
|
78
|
-
traceId: parent._traceId,
|
|
79
|
-
spanId: id(),
|
|
80
|
-
parentId: parent._spanId,
|
|
81
|
-
sampling: parent._sampling,
|
|
82
|
-
baggageItems: Object.assign({}, parent._baggageItems),
|
|
83
|
-
trace: parent._trace
|
|
84
|
-
})
|
|
85
|
-
} else {
|
|
86
|
-
const spanId = id()
|
|
87
|
-
spanContext = new SpanContext({
|
|
88
|
-
traceId: spanId,
|
|
89
|
-
spanId
|
|
90
|
-
})
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
spanContext._trace.started.push(this)
|
|
94
|
-
spanContext._trace.startTime = spanContext._trace.startTime || Date.now()
|
|
95
|
-
spanContext._trace.ticks = spanContext._trace.ticks || now()
|
|
96
|
-
|
|
97
|
-
return spanContext
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
_getTime () {
|
|
101
|
-
const { startTime, ticks } = this._spanContext._trace
|
|
102
|
-
|
|
103
|
-
return startTime + now() - ticks
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
_context () {
|
|
69
|
+
context () {
|
|
107
70
|
return this._spanContext
|
|
108
71
|
}
|
|
109
72
|
|
|
110
|
-
|
|
73
|
+
tracer () {
|
|
111
74
|
return this._parentTracer
|
|
112
75
|
}
|
|
113
76
|
|
|
114
|
-
|
|
77
|
+
setOperationName (name) {
|
|
115
78
|
this._spanContext._name = name
|
|
79
|
+
return this
|
|
116
80
|
}
|
|
117
81
|
|
|
118
|
-
|
|
82
|
+
setBaggageItem (key, value) {
|
|
119
83
|
this._spanContext._baggageItems[key] = value
|
|
84
|
+
return this
|
|
120
85
|
}
|
|
121
86
|
|
|
122
|
-
|
|
87
|
+
getBaggageItem (key) {
|
|
123
88
|
return this._spanContext._baggageItems[key]
|
|
124
89
|
}
|
|
125
90
|
|
|
126
|
-
|
|
127
|
-
|
|
91
|
+
setTag (key, value) {
|
|
92
|
+
this._addTags({ [key]: value })
|
|
93
|
+
return this
|
|
94
|
+
}
|
|
128
95
|
|
|
129
|
-
|
|
96
|
+
addTags (keyValueMap) {
|
|
97
|
+
this._addTags(keyValueMap)
|
|
98
|
+
return this
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
log () {
|
|
102
|
+
return this
|
|
130
103
|
}
|
|
131
104
|
|
|
132
|
-
|
|
105
|
+
logEvent () {}
|
|
106
|
+
|
|
107
|
+
finish (finishTime) {
|
|
133
108
|
if (this._duration !== undefined) {
|
|
134
109
|
return
|
|
135
110
|
}
|
|
@@ -157,6 +132,45 @@ class DatadogSpan extends Span {
|
|
|
157
132
|
this._spanContext._isFinished = true
|
|
158
133
|
this._processor.process(this)
|
|
159
134
|
}
|
|
135
|
+
|
|
136
|
+
_createContext (parent) {
|
|
137
|
+
let spanContext
|
|
138
|
+
|
|
139
|
+
if (parent) {
|
|
140
|
+
spanContext = new SpanContext({
|
|
141
|
+
traceId: parent._traceId,
|
|
142
|
+
spanId: id(),
|
|
143
|
+
parentId: parent._spanId,
|
|
144
|
+
sampling: parent._sampling,
|
|
145
|
+
baggageItems: Object.assign({}, parent._baggageItems),
|
|
146
|
+
trace: parent._trace
|
|
147
|
+
})
|
|
148
|
+
} else {
|
|
149
|
+
const spanId = id()
|
|
150
|
+
spanContext = new SpanContext({
|
|
151
|
+
traceId: spanId,
|
|
152
|
+
spanId
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
spanContext._trace.started.push(this)
|
|
157
|
+
spanContext._trace.startTime = spanContext._trace.startTime || dateNow()
|
|
158
|
+
spanContext._trace.ticks = spanContext._trace.ticks || now()
|
|
159
|
+
|
|
160
|
+
return spanContext
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
_getTime () {
|
|
164
|
+
const { startTime, ticks } = this._spanContext._trace
|
|
165
|
+
|
|
166
|
+
return startTime + now() - ticks
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
_addTags (keyValuePairs) {
|
|
170
|
+
tagger.add(this._spanContext._tags, keyValuePairs)
|
|
171
|
+
|
|
172
|
+
this._prioritySampler.sample(this, false)
|
|
173
|
+
}
|
|
160
174
|
}
|
|
161
175
|
|
|
162
176
|
function createRegistry (type) {
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const opentracing = require('opentracing')
|
|
4
3
|
const os = require('os')
|
|
5
|
-
const Tracer = opentracing.Tracer
|
|
6
|
-
const Reference = opentracing.Reference
|
|
7
4
|
const Span = require('./span')
|
|
8
|
-
const SpanContext = require('./span_context')
|
|
9
5
|
const SpanProcessor = require('../span_processor')
|
|
10
6
|
const PrioritySampler = require('../priority_sampler')
|
|
11
7
|
const TextMapPropagator = require('./propagation/text_map')
|
|
@@ -17,14 +13,13 @@ const formats = require('../../../../ext/formats')
|
|
|
17
13
|
const log = require('../log')
|
|
18
14
|
const metrics = require('../metrics')
|
|
19
15
|
const getExporter = require('../exporter')
|
|
16
|
+
const SpanContext = require('./span_context')
|
|
20
17
|
|
|
21
|
-
const REFERENCE_CHILD_OF =
|
|
22
|
-
const REFERENCE_FOLLOWS_FROM =
|
|
18
|
+
const REFERENCE_CHILD_OF = 'child_of'
|
|
19
|
+
const REFERENCE_FOLLOWS_FROM = 'follows_from'
|
|
23
20
|
|
|
24
|
-
class DatadogTracer
|
|
21
|
+
class DatadogTracer {
|
|
25
22
|
constructor (config) {
|
|
26
|
-
super()
|
|
27
|
-
|
|
28
23
|
const Exporter = getExporter(config.experimental.exporter)
|
|
29
24
|
|
|
30
25
|
this._service = config.service
|
|
@@ -49,32 +44,34 @@ class DatadogTracer extends Tracer {
|
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
47
|
+
startSpan (name, options = {}) {
|
|
48
|
+
const parent = options.childOf
|
|
49
|
+
? getContext(options.childOf)
|
|
50
|
+
: getParent(options.references)
|
|
57
51
|
|
|
58
|
-
_startSpanInternal (name, fields = {}, parent) {
|
|
59
52
|
const tags = {
|
|
60
53
|
'service.name': this._service
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
const span = new Span(this, this._processor, this._prioritySampler, {
|
|
64
|
-
operationName:
|
|
57
|
+
operationName: options.operationName || name,
|
|
65
58
|
parent,
|
|
66
59
|
tags,
|
|
67
|
-
startTime:
|
|
60
|
+
startTime: options.startTime,
|
|
68
61
|
hostname: this._hostname
|
|
69
62
|
}, this._debug)
|
|
70
63
|
|
|
71
64
|
span.addTags(this._tags)
|
|
72
|
-
span.addTags(
|
|
65
|
+
span.addTags(options.tags)
|
|
73
66
|
|
|
74
67
|
return span
|
|
75
68
|
}
|
|
76
69
|
|
|
77
|
-
|
|
70
|
+
inject (spanContext, format, carrier) {
|
|
71
|
+
if (spanContext instanceof Span) {
|
|
72
|
+
spanContext = spanContext.context()
|
|
73
|
+
}
|
|
74
|
+
|
|
78
75
|
try {
|
|
79
76
|
this._prioritySampler.sample(spanContext)
|
|
80
77
|
this._propagators[format].inject(spanContext, carrier)
|
|
@@ -82,11 +79,9 @@ class DatadogTracer extends Tracer {
|
|
|
82
79
|
log.error(e)
|
|
83
80
|
metrics.increment('datadog.tracer.node.inject.errors', true)
|
|
84
81
|
}
|
|
85
|
-
|
|
86
|
-
return this
|
|
87
82
|
}
|
|
88
83
|
|
|
89
|
-
|
|
84
|
+
extract (format, carrier) {
|
|
90
85
|
try {
|
|
91
86
|
return this._propagators[format].extract(carrier)
|
|
92
87
|
} catch (e) {
|
|
@@ -97,31 +92,31 @@ class DatadogTracer extends Tracer {
|
|
|
97
92
|
}
|
|
98
93
|
}
|
|
99
94
|
|
|
95
|
+
function getContext (spanContext) {
|
|
96
|
+
if (spanContext instanceof Span) {
|
|
97
|
+
spanContext = spanContext.context()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (!(spanContext instanceof SpanContext)) {
|
|
101
|
+
spanContext = null
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return spanContext
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
function getParent (references = []) {
|
|
101
108
|
let parent = null
|
|
102
109
|
|
|
103
110
|
for (let i = 0; i < references.length; i++) {
|
|
104
111
|
const ref = references[i]
|
|
105
|
-
|
|
106
|
-
if (!(ref instanceof Reference)) {
|
|
107
|
-
log.error(() => `Expected ${ref} to be an instance of opentracing.Reference`)
|
|
108
|
-
continue
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const spanContext = ref.referencedContext()
|
|
112
112
|
const type = ref.type()
|
|
113
113
|
|
|
114
|
-
if (spanContext && !(spanContext instanceof SpanContext)) {
|
|
115
|
-
log.error(() => `Expected ${spanContext} to be an instance of SpanContext`)
|
|
116
|
-
continue
|
|
117
|
-
}
|
|
118
|
-
|
|
119
114
|
if (type === REFERENCE_CHILD_OF) {
|
|
120
|
-
parent = ref
|
|
115
|
+
parent = ref.referencedContext()
|
|
121
116
|
break
|
|
122
117
|
} else if (type === REFERENCE_FOLLOWS_FROM) {
|
|
123
118
|
if (!parent) {
|
|
124
|
-
parent = ref
|
|
119
|
+
parent = ref.referencedContext()
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
122
|
}
|
|
@@ -1,112 +1,142 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { channel } = require('diagnostics_channel')
|
|
4
|
+
const { isFalse } = require('./util')
|
|
4
5
|
const plugins = require('./plugins')
|
|
5
6
|
const log = require('./log')
|
|
6
7
|
|
|
8
|
+
const loadChannel = channel('dd-trace:instrumentation:load')
|
|
9
|
+
|
|
7
10
|
// instrument everything that needs Plugin System V2 instrumentation
|
|
8
11
|
require('../../datadog-instrumentations')
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
function getConfig (name, config = {}) {
|
|
12
|
-
const enabled = process.env[`DD_TRACE_${name.toUpperCase()}_ENABLED`.replace(/[^a-z0-9_]/ig, '_')]
|
|
13
|
-
if (enabled !== undefined) {
|
|
14
|
-
config.enabled = isTrue(enabled)
|
|
15
|
-
}
|
|
13
|
+
const { DD_TRACE_DISABLED_PLUGINS } = process.env
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
15
|
+
const disabledPlugins = new Set(
|
|
16
|
+
DD_TRACE_DISABLED_PLUGINS && DD_TRACE_DISABLED_PLUGINS.split(',').map(plugin => plugin.trim())
|
|
17
|
+
)
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
}
|
|
19
|
+
// TODO actually ... should we be looking at envrionment variables this deep down in the code?
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
// are migrated to the new system, can stay here for now, since this is the level
|
|
27
|
-
// this check maybe should be happening on, even if it deals with env variabls
|
|
28
|
-
const disabledPlugins = process.env.DD_TRACE_DISABLED_PLUGINS
|
|
21
|
+
const pluginClasses = {}
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
23
|
+
loadChannel.subscribe(({ name }) => {
|
|
24
|
+
const Plugin = plugins[name]
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
if (!Plugin || typeof Plugin !== 'function') return
|
|
27
|
+
if (!pluginClasses[Plugin.name]) {
|
|
28
|
+
const envName = `DD_TRACE_${Plugin.name.toUpperCase()}_ENABLED`
|
|
29
|
+
const enabled = process.env[envName.replace(/[^a-z0-9_]/ig, '_')]
|
|
30
|
+
|
|
31
|
+
// TODO: remove the need to load the plugin class in order to disable the plugin
|
|
32
|
+
if (isFalse(enabled) || disabledPlugins.has(Plugin.name)) {
|
|
33
|
+
log.debug(`Plugin "${Plugin.name}" was disabled via configuration option.`)
|
|
34
|
+
|
|
35
|
+
pluginClasses[Plugin.name] = null
|
|
36
|
+
} else {
|
|
37
|
+
pluginClasses[Plugin.name] = Plugin
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
})
|
|
35
41
|
|
|
36
42
|
// TODO this must always be a singleton.
|
|
37
43
|
module.exports = class PluginManager {
|
|
38
44
|
constructor (tracer) {
|
|
39
45
|
this._tracer = tracer
|
|
46
|
+
this._tracerConfig = null
|
|
40
47
|
this._pluginsByName = {}
|
|
41
48
|
this._configsByName = {}
|
|
42
|
-
|
|
49
|
+
|
|
50
|
+
this._loadedSubscriber = ({ name }) => {
|
|
51
|
+
const Plugin = plugins[name]
|
|
52
|
+
|
|
53
|
+
if (!Plugin || typeof Plugin !== 'function') return
|
|
54
|
+
|
|
55
|
+
this.loadPlugin(Plugin.name)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
loadChannel.subscribe(this._loadedSubscriber)
|
|
43
59
|
}
|
|
44
60
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
loadPlugin (name) {
|
|
62
|
+
const Plugin = pluginClasses[name]
|
|
63
|
+
|
|
64
|
+
if (!Plugin) return
|
|
65
|
+
if (!this._pluginsByName[name]) {
|
|
66
|
+
this._pluginsByName[name] = new Plugin(this._tracer)
|
|
49
67
|
}
|
|
50
|
-
if (!
|
|
51
|
-
|
|
68
|
+
if (!this._tracerConfig) return // TODO: don't wait for tracer to be initialized
|
|
69
|
+
|
|
70
|
+
const pluginConfig = this._configsByName[name] || {
|
|
71
|
+
enabled: this._tracerConfig.plugins !== false
|
|
52
72
|
}
|
|
53
73
|
|
|
54
|
-
this.
|
|
55
|
-
...this.
|
|
74
|
+
this._pluginsByName[name].configure({
|
|
75
|
+
...this._getSharedConfig(name),
|
|
56
76
|
...pluginConfig
|
|
57
|
-
}
|
|
77
|
+
})
|
|
78
|
+
}
|
|
58
79
|
|
|
59
|
-
|
|
60
|
-
|
|
80
|
+
// TODO: merge config instead of replacing
|
|
81
|
+
configurePlugin (name, pluginConfig) {
|
|
82
|
+
const enabled = this._isEnabled(pluginConfig)
|
|
83
|
+
|
|
84
|
+
this._configsByName[name] = {
|
|
85
|
+
...pluginConfig,
|
|
86
|
+
enabled
|
|
61
87
|
}
|
|
88
|
+
|
|
89
|
+
this.loadPlugin(name)
|
|
62
90
|
}
|
|
63
91
|
|
|
64
92
|
// like instrumenter.enable()
|
|
65
93
|
configure (config = {}) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
for (const PluginClass of Object.values(plugins)) {
|
|
69
|
-
const name = PluginClass.name
|
|
94
|
+
this._tracerConfig = config
|
|
70
95
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
96
|
+
for (const name in pluginClasses) {
|
|
97
|
+
this.loadPlugin(name)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
75
100
|
|
|
76
|
-
|
|
101
|
+
// This is basically just for testing. like intrumenter.disable()
|
|
102
|
+
destroy () {
|
|
103
|
+
for (const name in this._pluginsByName) {
|
|
104
|
+
this._pluginsByName[name].configure({ enabled: false })
|
|
105
|
+
}
|
|
77
106
|
|
|
78
|
-
|
|
107
|
+
loadChannel.unsubscribe(this._loadedSubscriber)
|
|
108
|
+
}
|
|
79
109
|
|
|
80
|
-
|
|
110
|
+
_isEnabled (pluginConfig) {
|
|
111
|
+
if (typeof pluginConfig === 'boolean') return pluginConfig
|
|
112
|
+
if (!pluginConfig) return true
|
|
81
113
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
114
|
+
return pluginConfig.enabled !== false
|
|
115
|
+
}
|
|
85
116
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
117
|
+
// TODO: figure out a better way to handle this
|
|
118
|
+
_getSharedConfig (name) {
|
|
119
|
+
const {
|
|
120
|
+
logInjection,
|
|
121
|
+
serviceMapping,
|
|
122
|
+
experimental
|
|
123
|
+
} = this._tracerConfig
|
|
89
124
|
|
|
90
|
-
|
|
91
|
-
if (name === 'mocha') {
|
|
92
|
-
pluginConfig.isAgentlessEnabled = experimental && experimental.exporter === 'datadog'
|
|
93
|
-
}
|
|
125
|
+
const sharedConfig = {}
|
|
94
126
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
127
|
+
if (logInjection !== undefined) {
|
|
128
|
+
sharedConfig.logInjection = logInjection
|
|
129
|
+
}
|
|
98
130
|
|
|
99
|
-
|
|
131
|
+
// TODO: update so that it's available for every CI Visibility's plugin
|
|
132
|
+
if (name === 'mocha') {
|
|
133
|
+
sharedConfig.isAgentlessEnabled = experimental && experimental.exporter === 'datadog'
|
|
100
134
|
}
|
|
101
|
-
}
|
|
102
135
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
for (const name in this._pluginsByName) {
|
|
106
|
-
this._pluginsByName[name].configure({ enabled: false })
|
|
136
|
+
if (serviceMapping && serviceMapping[name]) {
|
|
137
|
+
sharedConfig.service = serviceMapping[name]
|
|
107
138
|
}
|
|
108
139
|
|
|
109
|
-
|
|
110
|
-
this._configsByName = {}
|
|
140
|
+
return sharedConfig
|
|
111
141
|
}
|
|
112
142
|
}
|
|
@@ -1,49 +1,61 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
'
|
|
5
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
4
|
+
get '@cucumber/cucumber' () { return require('../../../datadog-plugin-cucumber/src') },
|
|
5
|
+
get '@elastic/elasticsearch' () { return require('../../../datadog-plugin-elasticsearch/src') },
|
|
6
|
+
get '@elastic/transport' () { return require('../../../datadog-plugin-elasticsearch/src') },
|
|
7
|
+
get '@google-cloud/pubsub' () { return require('../../../datadog-plugin-google-cloud-pubsub/src') },
|
|
8
|
+
get '@grpc/grpc-js' () { return require('../../../datadog-plugin-grpc/src') },
|
|
9
|
+
get '@hapi/hapi' () { return require('../../../datadog-plugin-hapi/src') },
|
|
10
|
+
get '@koa/router' () { return require('../../../datadog-plugin-koa/src') },
|
|
11
|
+
get '@node-redis/client' () { return require('../../../datadog-plugin-redis/src') },
|
|
12
|
+
get 'amqp10' () { return require('../../../datadog-plugin-amqp10/src') },
|
|
13
|
+
get 'amqplib' () { return require('../../../datadog-plugin-amqplib/src') },
|
|
14
|
+
get 'aws-sdk' () { return require('../../../datadog-plugin-aws-sdk/src') },
|
|
15
|
+
get 'bunyan' () { return require('../../../datadog-plugin-bunyan/src') },
|
|
16
|
+
get 'cassandra-driver' () { return require('../../../datadog-plugin-cassandra-driver/src') },
|
|
17
|
+
get 'connect' () { return require('../../../datadog-plugin-connect/src') },
|
|
18
|
+
get 'couchbase' () { return require('../../../datadog-plugin-couchbase/src') },
|
|
19
|
+
get 'cypress' () { return require('../../../datadog-plugin-cypress/src') },
|
|
20
|
+
get 'dns' () { return require('../../../datadog-plugin-dns/src') },
|
|
21
|
+
get 'elasticsearch' () { return require('../../../datadog-plugin-elasticsearch/src') },
|
|
22
|
+
get 'express' () { return require('../../../datadog-plugin-express/src') },
|
|
23
|
+
get 'fastify' () { return require('../../../datadog-plugin-fastify/src') },
|
|
24
|
+
get 'find-my-way' () { return require('../../../datadog-plugin-find-my-way/src') },
|
|
25
|
+
get 'graphql' () { return require('../../../datadog-plugin-graphql/src') },
|
|
26
|
+
get 'grpc' () { return require('../../../datadog-plugin-grpc/src') },
|
|
27
|
+
get 'hapi' () { return require('../../../datadog-plugin-hapi/src') },
|
|
28
|
+
get 'http' () { return require('../../../datadog-plugin-http/src') },
|
|
29
|
+
get 'http2' () { return require('../../../datadog-plugin-http2/src') },
|
|
30
|
+
get 'https' () { return require('../../../datadog-plugin-http/src') },
|
|
31
|
+
get 'ioredis' () { return require('../../../datadog-plugin-ioredis/src') },
|
|
32
|
+
get 'jest-environment-node' () { return require('../../../datadog-plugin-jest/src') },
|
|
33
|
+
get 'jest-environment-jsdom' () { return require('../../../datadog-plugin-jest/src') },
|
|
34
|
+
get 'jest-jasmine2' () { return require('../../../datadog-plugin-jest/src') },
|
|
35
|
+
get 'koa' () { return require('../../../datadog-plugin-koa/src') },
|
|
36
|
+
get 'koa-router' () { return require('../../../datadog-plugin-koa/src') },
|
|
37
|
+
get 'kafkajs' () { return require('../../../datadog-plugin-kafkajs/src') },
|
|
38
|
+
get 'memcached' () { return require('../../../datadog-plugin-memcached/src') },
|
|
39
|
+
get 'microgateway-core' () { return require('../../../datadog-plugin-microgateway-core/src') },
|
|
40
|
+
get 'mocha' () { return require('../../../datadog-plugin-mocha/src') },
|
|
41
|
+
get 'mocha-each' () { return require('../../../datadog-plugin-mocha/src') },
|
|
42
|
+
get 'moleculer' () { return require('../../../datadog-plugin-moleculer/src') },
|
|
43
|
+
get 'mongodb' () { return require('../../../datadog-plugin-mongodb-core/src') },
|
|
44
|
+
get 'mongodb-core' () { return require('../../../datadog-plugin-mongodb-core/src') },
|
|
45
|
+
get 'mysql' () { return require('../../../datadog-plugin-mysql/src') },
|
|
46
|
+
get 'mysql2' () { return require('../../../datadog-plugin-mysql2/src') },
|
|
47
|
+
get 'net' () { return require('../../../datadog-plugin-net/src') },
|
|
48
|
+
get 'next' () { return require('../../../datadog-plugin-next/src') },
|
|
49
|
+
get 'oracledb' () { return require('../../../datadog-plugin-oracledb/src') },
|
|
50
|
+
get 'paperplane' () { return require('../../../datadog-plugin-paperplane/src') },
|
|
51
|
+
get 'pg' () { return require('../../../datadog-plugin-pg/src') },
|
|
52
|
+
get 'pino' () { return require('../../../datadog-plugin-pino/src') },
|
|
53
|
+
get 'pino-pretty' () { return require('../../../datadog-plugin-pino/src') },
|
|
54
|
+
get 'redis' () { return require('../../../datadog-plugin-redis/src') },
|
|
55
|
+
get 'restify' () { return require('../../../datadog-plugin-restify/src') },
|
|
56
|
+
get 'rhea' () { return require('../../../datadog-plugin-rhea/src') },
|
|
57
|
+
get 'router' () { return require('../../../datadog-plugin-router/src') },
|
|
58
|
+
get 'sharedb' () { return require('../../../datadog-plugin-sharedb/src') },
|
|
59
|
+
get 'tedious' () { return require('../../../datadog-plugin-tedious/src') },
|
|
60
|
+
get 'winston' () { return require('../../../datadog-plugin-winston/src') }
|
|
49
61
|
}
|