Skip to content

Commit 6e2be9b

Browse files
authored
Merge pull request #293 from DataDog/v0.6.0
v0.6.0
2 parents ee093d8 + 40c3a20 commit 6e2be9b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3466
-439
lines changed

.circleci/config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ docker-base: &docker-base
2020
- "ES_JAVA_OPTS=-Xms64m -Xmx64m"
2121
- &rabbitmq
2222
image: rabbitmq:3.6-alpine
23+
- &qpid
24+
image: scholzj/qpid-cpp:1.38.0
25+
command: -p 5673
26+
environment:
27+
- QPIDD_ADMIN_USERNAME=admin
28+
- QPIDD_ADMIN_PASSWORD=admin
29+
- &memcached
30+
image: memcached:1.5-alpine
2331
build-node-base: &node-base
2432
<<: *docker-base
2533
working_directory: ~/dd-trace-js
@@ -90,6 +98,8 @@ jobs:
9098
- *mongo
9199
- *elasticsearch
92100
- *rabbitmq
101+
- *qpid
102+
- *memcached
93103
build-node-6:
94104
<<: *node-base
95105
docker:
@@ -100,6 +110,8 @@ jobs:
100110
- *mongo
101111
- *elasticsearch
102112
- *rabbitmq
113+
- *qpid
114+
- *memcached
103115
build-node-8:
104116
<<: *node-base
105117
docker:
@@ -110,6 +122,8 @@ jobs:
110122
- *mongo
111123
- *elasticsearch
112124
- *rabbitmq
125+
- *qpid
126+
- *memcached
113127
build-node-latest:
114128
<<: *node-base
115129
docker:
@@ -120,6 +134,8 @@ jobs:
120134
- *mongo
121135
- *elasticsearch
122136
- *rabbitmq
137+
- *qpid
138+
- *memcached
123139

124140
workflows:
125141
version: 2

LICENSE-3rdparty.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require,require-in-the-middle,MIT,Copyright 2016-2018 Thomas Watson Steen
1616
require,safe-buffer,MIT,Copyright Feross Aboukhadijeh
1717
require,shimmer,BSD-2-Clause,Copyright Forrest L Norvell
1818
require,url-parse,MIT,Copyright 2015 Unshift.io Arnout Kazemier the Contributors
19+
dev,amqp10,MIT,Copyright 2014 Michael Lanzetta
1920
dev,amqplib,MIT,Copyright 2013-2014 Michael Bridgen
2021
dev,axios,MIT,Copyright 2014-present Matt Zabriskie
2122
dev,benchmark,MIT,Copyright 2010-2016 Mathias Bynens Robert Kieffer John-David Dalton
@@ -36,6 +37,7 @@ dev,graphql,MIT,Copyright 2015-present Facebook Inc.
3637
dev,gulp,MIT,Copyright 2013-2017 Blaine Bublitz Eric Schoffstall and other contributors
3738
dev,gulp-jsdoc3,Apache-2.0,Copyright Marc Udoff
3839
dev,jsdoc,Apache-2.0,Copyright 2011-present Michael Mathews and the contributors to JSDoc
40+
dev,memcached,MIT,Copyright 2010 Arnout Kazemier and 3rd-Eden
3941
dev,mocha,MIT,Copyright 2011-2018 JS Foundation and contributors https://js.foundation
4042
dev,mongodb-core,Apache-2.0,Copyright Christian Kvalheim
4143
dev,mysql,MIT,Copyright 2012 Felix Geisendörfer and contributors

benchmark/stubs/span.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ const span = {
1818
trace: {
1919
started: [span, span],
2020
finished: [span, span]
21-
}
21+
},
22+
tags: {
23+
resource: '/resource',
24+
type: 'web',
25+
error: true
26+
},
27+
metrics: {
28+
[SAMPLE_RATE_METRIC_KEY]: 1
29+
},
30+
sampled: true,
31+
sampling: {}
2232
}),
2333
_operationName: 'operation',
24-
_tags: {
25-
resource: '/resource',
26-
type: 'web',
27-
error: true
28-
},
29-
_metrics: {
30-
[SAMPLE_RATE_METRIC_KEY]: 1
31-
},
3234
_startTime: 1500000000000.123456,
3335
_duration: 100
3436
}

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,15 @@ services:
3030
image: rabbitmq:3.6-alpine
3131
ports:
3232
- "127.0.0.1:5672:5672"
33+
qpid:
34+
image: scholzj/qpid-cpp:1.38.0
35+
command: -p 5673
36+
environment:
37+
- QPIDD_ADMIN_USERNAME=admin
38+
- QPIDD_ADMIN_PASSWORD=admin
39+
ports:
40+
- "127.0.0.1:5673:5673"
41+
memcached:
42+
image: memcached:1.5-alpine
43+
ports:
44+
- "11211:11211"

docs/API.md

Lines changed: 101 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ Each integration also has its own list of default tags. These tags get automatic
136136
| http.url | The complete URL of the request. |
137137
| http.method | The HTTP method of the request. |
138138
| http.status_code | The HTTP status code of the response. |
139+
| http.headers.* | A recorded HTTP header. |
139140

140141
<h5 id="express-config">Configuration Options</h5>
141142

142143
| Option | Default | Description |
143144
|------------------|---------------------------|----------------------------------------|
144145
| service | *Service name of the app* | The service name for this integration. |
145146
| validateStatus | `code => code < 500` | Callback function to determine if there was an error. It should take a status code as its only parameter and return `true` for success or `false` for errors. |
147+
| headers | `[]` | An array of headers to include in the span metadata. |
146148

147149
<h3 id="graphql">graphql</h3>
148150

@@ -166,15 +168,37 @@ query HelloWorld {
166168

167169
<h5 id="graphql-tags">Tags</h5>
168170

171+
| Tag | Description |
172+
|---------------------|-----------------------------------------------------------|
173+
| graphql.document | The original GraphQL document. |
174+
| graphql.variables.* | The variables applied to the document. |
175+
176+
<h5 id="graphql-config">Configuration Options</h5>
177+
178+
| Option | Default | Description |
179+
|-----------------|--------------------------------------------------|------------------------------------------------------------------------|
180+
| service | *Service name of the app suffixed with -graphql* | The service name for this integration. |
181+
| variables | `undefined` | A callback to enable recording of variables. By default, no variables are recorded. For example, using `variables => variables` would record all variables. |
182+
| depth | -1 | The maximum depth of fields/resolvers to instrument. Set to `0` to only instrument the operation or to -1 to instrument all fields/resolvers. |
183+
184+
<h3 id="hapi">hapi</h3>
185+
186+
<h5 id="hapi-tags">Tags</h5>
187+
169188
| Tag | Description |
170189
|------------------|-----------------------------------------------------------|
171-
| graphql.document | The original GraphQL document. |
190+
| http.url | The complete URL of the request. |
191+
| http.method | The HTTP method of the request. |
192+
| http.status_code | The HTTP status code of the response. |
193+
| http.headers.* | A recorded HTTP header. |
172194

173-
<h5 id="graphql-config">Configuration Options</h5>
195+
<h5 id="hapi-config">Configuration Options</h5>
174196

175-
| Option | Default | Description |
176-
|---------|--------------------------------------------------|----------------------------------------|
177-
| service | *Service name of the app suffixed with -graphql* | The service name for this integration. |
197+
| Option | Default | Description |
198+
|------------------|---------------------------|----------------------------------------|
199+
| service | *Service name of the app* | The service name for this integration. |
200+
| validateStatus | `code => code < 500` | Callback function to determine if there was an error. It should take a status code as its only parameter and return `true` for success or `false` for errors. |
201+
| headers | `[]` | An array of headers to include in the span metadata. |
178202

179203
<h3 id="http">http / https</h3>
180204

@@ -193,6 +217,57 @@ query HelloWorld {
193217
| service | http-client | The service name for this integration. |
194218
| splitByDomain | false | Use the remote endpoint host as the service name instead of the default. |
195219

220+
<h3 id="ioredis">ioredis</h3>
221+
222+
<h5 id="ioredis-tags">Tags</h5>
223+
224+
| Tag | Description |
225+
|------------------|-----------------------------------------------------------|
226+
| db.name | The index of the queried database. |
227+
| out.host | The host of the Redis server. |
228+
| out.port | The port of the Redis server. |
229+
230+
<h5 id="ioredis-config">Configuration Options</h5>
231+
232+
| Option | Default | Description |
233+
|------------------|------------------|----------------------------------------|
234+
| service | redis | The service name for this integration. |
235+
236+
<h3 id="koa">koa</h3>
237+
238+
<h5 id="koa-tags">Tags</h5>
239+
240+
| Tag | Description |
241+
|------------------|-----------------------------------------------------------|
242+
| http.url | The complete URL of the request. |
243+
| http.method | The HTTP method of the request. |
244+
| http.status_code | The HTTP status code of the response. |
245+
| http.headers.* | A recorded HTTP header. |
246+
247+
<h5 id="koa-config">Configuration Options</h5>
248+
249+
| Option | Default | Description |
250+
|------------------|---------------------------|----------------------------------------|
251+
| service | *Service name of the app* | The service name for this integration. |
252+
| validateStatus | `code => code < 500` | Callback function to determine if there was an error. It should take a status code as its only parameter and return `true` for success or `false` for errors. |
253+
| headers | `[]` | An array of headers to include in the span metadata. |
254+
255+
<h3 id="memcached">memcached</h3>
256+
257+
<h5 id="memcached-tags">Tags</h5>
258+
259+
| Tag | Description |
260+
|------------------|-----------------------------------------------------------|
261+
| memcached.query | The query sent to the server. |
262+
| out.host | The host of the Memcached server. |
263+
| out.port | The port of the Memcached server. |
264+
265+
<h5 id="memcached-config">Configuration Options</h5>
266+
267+
| Option | Default | Description |
268+
|------------------|------------------|----------------------------------------|
269+
| service | memcached | The service name for this integration. |
270+
196271
<h3 id="mongodb-core">mongodb-core</h3>
197272

198273
<h5 id="mongodb-core-tags">Tags</h5>
@@ -277,6 +352,26 @@ query HelloWorld {
277352
|------------------|------------------|----------------------------------------|
278353
| service | redis | The service name for this integration. |
279354

355+
<h3 id="restify">restify</h3>
356+
357+
<h5 id="restify-tags">Tags</h5>
358+
359+
| Tag | Description |
360+
|------------------|-----------------------------------------------------------|
361+
| http.url | The complete URL of the request. |
362+
| http.method | The HTTP method of the request. |
363+
| http.status_code | The HTTP status code of the response. |
364+
| http.headers.* | A recorded HTTP header. |
365+
366+
<h5 id="restify-config">Configuration Options</h5>
367+
368+
| Option | Default | Description |
369+
|------------------|---------------------------|----------------------------------------|
370+
| service | *Service name of the app* | The service name for this integration. |
371+
| validateStatus | `code => code < 500` | Callback function to determine if there was an error. It should take a status code as its only parameter and return `true` for success or `false` for errors. |
372+
| headers | `[]` | An array of headers to include in the span metadata. |
373+
374+
280375
<h2 id="advanced-configuration">Advanced Configuration</h2>
281376

282377
<h3 id="tracer-settings">Tracer settings</h3>
@@ -285,6 +380,7 @@ Options can be configured as a parameter to the [init()](https://datadog.github.
285380

286381
| Config | Environment Variable | Default | Description |
287382
| ------------- | ---------------------------- | --------- | ----------- |
383+
| enabled | DD_TRACE_ENABLED | true | Whether to enable the tracer. |
288384
| debug | DD_TRACE_DEBUG | false | Enable debug logging in the tracer. |
289385
| service | DD_SERVICE_NAME | | The service name to be used for this program. |
290386
| hostname | DD_TRACE_AGENT_HOSTNAME | localhost | The address of the trace agent that the tracer will submit to. |

ext/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict'
2+
3+
const priority = require('./priority')
4+
const tags = require('./tags')
5+
6+
module.exports = {
7+
priority,
8+
tags
9+
}

ext/kinds.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
3+
module.exports = {
4+
SERVER: 'server',
5+
CLIENT: 'client',
6+
PRODUCER: 'producer',
7+
CONSUMER: 'consumer'
8+
}

ext/priority.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict'
2+
3+
module.exports = {
4+
USER_REJECT: -1,
5+
AUTO_REJECT: 0,
6+
AUTO_KEEP: 1,
7+
USER_KEEP: 2
8+
}

ext/tags.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict'
2+
3+
module.exports = {
4+
// Common
5+
SERVICE_NAME: 'service.name',
6+
RESOURCE_NAME: 'resource.name',
7+
SPAN_TYPE: 'span.type',
8+
SPAN_KIND: 'span.kind',
9+
SAMPLING_PRIORITY: 'sampling.priority',
10+
ERROR: 'error',
11+
12+
// HTTP
13+
HTTP_URL: 'http.url',
14+
HTTP_METHOD: 'http.method',
15+
HTTP_STATUS_CODE: 'http.status_code',
16+
HTTP_HEADERS: 'http.headers'
17+
}

ext/types.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict'
2+
3+
module.exports = {
4+
HTTP: 'http'
5+
}

lib/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = '0.5.6'
1+
module.exports = '0.6.0'

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dd-trace",
3-
"version": "0.5.6",
3+
"version": "0.6.0",
44
"description": "Datadog APM tracing client for JavaScript",
55
"main": "index.js",
66
"scripts": {
@@ -53,6 +53,7 @@
5353
"url-parse": "^1.4.3"
5454
},
5555
"devDependencies": {
56+
"amqp10": "^3.6.0",
5657
"amqplib": "^0.5.2",
5758
"axios": "^0.18.0",
5859
"benchmark": "^2.1.4",
@@ -73,6 +74,7 @@
7374
"gulp": "^3.9.1",
7475
"gulp-jsdoc3": "^2.0.0",
7576
"jsdoc": "^3.5.5",
77+
"memcached": "^2.2.2",
7678
"mocha": "^5.2.0",
7779
"mongodb-core": "^3.0.7",
7880
"mysql": "^2.15.0",

scripts/install_plugin_modules.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const crypto = require('crypto')
77
const semver = require('semver')
88
const exec = require('./helpers/exec')
99
const plugins = requireDir('../src/plugins')
10+
const externals = require('../test/plugins/externals')
1011

1112
const workspaces = new Set()
1213

@@ -19,14 +20,17 @@ function run () {
1920
}
2021

2122
function assertVersions () {
22-
Object.keys(plugins).filter(key => key !== 'index').forEach(key => {
23-
[].concat(plugins[key]).forEach(instrumentation => {
24-
[].concat(instrumentation.versions).forEach(version => {
25-
if (version) {
26-
assertModules(instrumentation.name, version)
27-
assertModules(instrumentation.name, semver.coerce(version).version)
28-
}
29-
})
23+
const internals = Object.keys(plugins)
24+
.filter(key => key !== 'index')
25+
.map(key => plugins[key])
26+
.reduce((prev, next) => prev.concat(next), [])
27+
28+
internals.concat(externals).forEach(instrumentation => {
29+
[].concat(instrumentation.versions).forEach(version => {
30+
if (version) {
31+
assertModules(instrumentation.name, version)
32+
assertModules(instrumentation.name, semver.coerce(version).version)
33+
}
3034
})
3135
})
3236
}

0 commit comments

Comments
 (0)