dd-trace 2.12.2 → 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/package.json +2 -2
- package/packages/datadog-instrumentations/index.js +1 -52
- 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-plugin-mocha/src/index.js +2 -2
- 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/{profiling/exporters → exporters/common}/form-data.js +0 -0
- package/packages/dd-trace/src/id.js +16 -13
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +6 -6
- 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/profiling/exporters/agent.js +1 -1
- package/packages/dd-trace/src/proxy.js +15 -8
- 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
|
@@ -9,7 +9,6 @@ const os = require('os')
|
|
|
9
9
|
const request = require('./exporters/common/request')
|
|
10
10
|
|
|
11
11
|
let config
|
|
12
|
-
let instrumenter
|
|
13
12
|
let pluginManager
|
|
14
13
|
|
|
15
14
|
let seqId = 0
|
|
@@ -20,17 +19,6 @@ const sentIntegrations = new Set()
|
|
|
20
19
|
|
|
21
20
|
function getIntegrations () {
|
|
22
21
|
const newIntegrations = []
|
|
23
|
-
for (const plugin of instrumenter._instrumented.keys()) {
|
|
24
|
-
if (sentIntegrations.has(plugin.name)) {
|
|
25
|
-
continue
|
|
26
|
-
}
|
|
27
|
-
newIntegrations.push({
|
|
28
|
-
name: plugin.name,
|
|
29
|
-
enabled: true,
|
|
30
|
-
auto_enabled: true
|
|
31
|
-
})
|
|
32
|
-
sentIntegrations.add(plugin.name)
|
|
33
|
-
}
|
|
34
22
|
for (const pluginName in pluginManager._pluginsByName) {
|
|
35
23
|
if (sentIntegrations.has(pluginName)) {
|
|
36
24
|
continue
|
|
@@ -146,12 +134,11 @@ function sendData (reqType, payload = {}) {
|
|
|
146
134
|
})
|
|
147
135
|
}
|
|
148
136
|
|
|
149
|
-
function start (aConfig,
|
|
137
|
+
function start (aConfig, thePluginManager) {
|
|
150
138
|
if (!aConfig.telemetryEnabled) {
|
|
151
139
|
return
|
|
152
140
|
}
|
|
153
141
|
config = aConfig
|
|
154
|
-
instrumenter = theInstrumenter
|
|
155
142
|
pluginManager = thePluginManager
|
|
156
143
|
application = createAppObject()
|
|
157
144
|
host = createHostObject()
|
|
@@ -7,8 +7,6 @@ const semver = require('semver')
|
|
|
7
7
|
const proxyquire = require('proxyquire')
|
|
8
8
|
const exec = require('./helpers/exec')
|
|
9
9
|
const childProcess = require('child_process')
|
|
10
|
-
const plugins = require('../packages/dd-trace/src/plugins')
|
|
11
|
-
const Plugin = require('../packages/dd-trace/src/plugins/plugin')
|
|
12
10
|
const externals = require('../packages/dd-trace/test/plugins/externals')
|
|
13
11
|
|
|
14
12
|
const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json')
|
|
@@ -16,6 +14,9 @@ const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require
|
|
|
16
14
|
const workspaces = new Set()
|
|
17
15
|
const versionLists = {}
|
|
18
16
|
const deps = {}
|
|
17
|
+
const names = []
|
|
18
|
+
const filter = process.env.hasOwnProperty('PLUGINS') && process.env.PLUGINS.split('|')
|
|
19
|
+
|
|
19
20
|
Object.keys(externals).forEach(external => externals[external].forEach(thing => {
|
|
20
21
|
if (thing.dep) {
|
|
21
22
|
if (!deps[external]) {
|
|
@@ -29,7 +30,10 @@ fs.readdirSync(path.join(__dirname, '../packages/datadog-instrumentations/src'))
|
|
|
29
30
|
.filter(file => file.endsWith('js'))
|
|
30
31
|
.forEach(file => {
|
|
31
32
|
file = file.replace('.js', '')
|
|
32
|
-
|
|
33
|
+
|
|
34
|
+
if (!filter || filter.includes(file)) {
|
|
35
|
+
names.push(file)
|
|
36
|
+
}
|
|
33
37
|
})
|
|
34
38
|
|
|
35
39
|
run()
|
|
@@ -42,32 +46,19 @@ async function run () {
|
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
async function assertVersions () {
|
|
45
|
-
let filter = []
|
|
46
|
-
let names = Object.keys(plugins)
|
|
47
|
-
|
|
48
|
-
if (process.env.hasOwnProperty('PLUGINS')) {
|
|
49
|
-
filter = process.env.PLUGINS.split('|')
|
|
50
|
-
names = names.filter(name => ~filter.indexOf(name))
|
|
51
|
-
}
|
|
52
|
-
|
|
53
49
|
const internals = names
|
|
54
50
|
.map(key => {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} catch (e) {
|
|
64
|
-
loadInstFile(`${name}.js`, instrumentations)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return instrumentations
|
|
68
|
-
} else {
|
|
69
|
-
return plugin
|
|
51
|
+
const instrumentations = []
|
|
52
|
+
const name = key
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
loadInstFile(`${name}/server.js`, instrumentations)
|
|
56
|
+
loadInstFile(`${name}/client.js`, instrumentations)
|
|
57
|
+
} catch (e) {
|
|
58
|
+
loadInstFile(`${name}.js`, instrumentations)
|
|
70
59
|
}
|
|
60
|
+
|
|
61
|
+
return instrumentations
|
|
71
62
|
})
|
|
72
63
|
.reduce((prev, next) => prev.concat(next), [])
|
|
73
64
|
|