Skip to content

Commit

Permalink
Merge pull request #293 from DataDog/v0.6.0
Browse files Browse the repository at this point in the history
v0.6.0
  • Loading branch information
rochdev authored Sep 25, 2018
2 parents ee093d8 + 40c3a20 commit 6e2be9b
Show file tree
Hide file tree
Showing 81 changed files with 3,466 additions and 439 deletions.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ docker-base: &docker-base
- "ES_JAVA_OPTS=-Xms64m -Xmx64m"
- &rabbitmq
image: rabbitmq:3.6-alpine
- &qpid
image: scholzj/qpid-cpp:1.38.0
command: -p 5673
environment:
- QPIDD_ADMIN_USERNAME=admin
- QPIDD_ADMIN_PASSWORD=admin
- &memcached
image: memcached:1.5-alpine
build-node-base: &node-base
<<: *docker-base
working_directory: ~/dd-trace-js
Expand Down Expand Up @@ -90,6 +98,8 @@ jobs:
- *mongo
- *elasticsearch
- *rabbitmq
- *qpid
- *memcached
build-node-6:
<<: *node-base
docker:
Expand All @@ -100,6 +110,8 @@ jobs:
- *mongo
- *elasticsearch
- *rabbitmq
- *qpid
- *memcached
build-node-8:
<<: *node-base
docker:
Expand All @@ -110,6 +122,8 @@ jobs:
- *mongo
- *elasticsearch
- *rabbitmq
- *qpid
- *memcached
build-node-latest:
<<: *node-base
docker:
Expand All @@ -120,6 +134,8 @@ jobs:
- *mongo
- *elasticsearch
- *rabbitmq
- *qpid
- *memcached

workflows:
version: 2
Expand Down
2 changes: 2 additions & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require,require-in-the-middle,MIT,Copyright 2016-2018 Thomas Watson Steen
require,safe-buffer,MIT,Copyright Feross Aboukhadijeh
require,shimmer,BSD-2-Clause,Copyright Forrest L Norvell
require,url-parse,MIT,Copyright 2015 Unshift.io Arnout Kazemier the Contributors
dev,amqp10,MIT,Copyright 2014 Michael Lanzetta
dev,amqplib,MIT,Copyright 2013-2014 Michael Bridgen
dev,axios,MIT,Copyright 2014-present Matt Zabriskie
dev,benchmark,MIT,Copyright 2010-2016 Mathias Bynens Robert Kieffer John-David Dalton
Expand All @@ -36,6 +37,7 @@ dev,graphql,MIT,Copyright 2015-present Facebook Inc.
dev,gulp,MIT,Copyright 2013-2017 Blaine Bublitz Eric Schoffstall and other contributors
dev,gulp-jsdoc3,Apache-2.0,Copyright Marc Udoff
dev,jsdoc,Apache-2.0,Copyright 2011-present Michael Mathews and the contributors to JSDoc
dev,memcached,MIT,Copyright 2010 Arnout Kazemier and 3rd-Eden
dev,mocha,MIT,Copyright 2011-2018 JS Foundation and contributors https://js.foundation
dev,mongodb-core,Apache-2.0,Copyright Christian Kvalheim
dev,mysql,MIT,Copyright 2012 Felix Geisendörfer and contributors
Expand Down
20 changes: 11 additions & 9 deletions benchmark/stubs/span.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ const span = {
trace: {
started: [span, span],
finished: [span, span]
}
},
tags: {
resource: '/resource',
type: 'web',
error: true
},
metrics: {
[SAMPLE_RATE_METRIC_KEY]: 1
},
sampled: true,
sampling: {}
}),
_operationName: 'operation',
_tags: {
resource: '/resource',
type: 'web',
error: true
},
_metrics: {
[SAMPLE_RATE_METRIC_KEY]: 1
},
_startTime: 1500000000000.123456,
_duration: 100
}
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ services:
image: rabbitmq:3.6-alpine
ports:
- "127.0.0.1:5672:5672"
qpid:
image: scholzj/qpid-cpp:1.38.0
command: -p 5673
environment:
- QPIDD_ADMIN_USERNAME=admin
- QPIDD_ADMIN_PASSWORD=admin
ports:
- "127.0.0.1:5673:5673"
memcached:
image: memcached:1.5-alpine
ports:
- "11211:11211"
106 changes: 101 additions & 5 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,15 @@ Each integration also has its own list of default tags. These tags get automatic
| http.url | The complete URL of the request. |
| http.method | The HTTP method of the request. |
| http.status_code | The HTTP status code of the response. |
| http.headers.* | A recorded HTTP header. |

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

| Option | Default | Description |
|------------------|---------------------------|----------------------------------------|
| service | *Service name of the app* | The service name for this integration. |
| 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. |
| headers | `[]` | An array of headers to include in the span metadata. |

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

Expand All @@ -166,15 +168,37 @@ query HelloWorld {

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

| Tag | Description |
|---------------------|-----------------------------------------------------------|
| graphql.document | The original GraphQL document. |
| graphql.variables.* | The variables applied to the document. |

<h5 id="graphql-config">Configuration Options</h5>

| Option | Default | Description |
|-----------------|--------------------------------------------------|------------------------------------------------------------------------|
| service | *Service name of the app suffixed with -graphql* | The service name for this integration. |
| variables | `undefined` | A callback to enable recording of variables. By default, no variables are recorded. For example, using `variables => variables` would record all variables. |
| 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. |

<h3 id="hapi">hapi</h3>

<h5 id="hapi-tags">Tags</h5>

| Tag | Description |
|------------------|-----------------------------------------------------------|
| graphql.document | The original GraphQL document. |
| http.url | The complete URL of the request. |
| http.method | The HTTP method of the request. |
| http.status_code | The HTTP status code of the response. |
| http.headers.* | A recorded HTTP header. |

<h5 id="graphql-config">Configuration Options</h5>
<h5 id="hapi-config">Configuration Options</h5>

| Option | Default | Description |
|---------|--------------------------------------------------|----------------------------------------|
| service | *Service name of the app suffixed with -graphql* | The service name for this integration. |
| Option | Default | Description |
|------------------|---------------------------|----------------------------------------|
| service | *Service name of the app* | The service name for this integration. |
| 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. |
| headers | `[]` | An array of headers to include in the span metadata. |

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

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

<h3 id="ioredis">ioredis</h3>

<h5 id="ioredis-tags">Tags</h5>

| Tag | Description |
|------------------|-----------------------------------------------------------|
| db.name | The index of the queried database. |
| out.host | The host of the Redis server. |
| out.port | The port of the Redis server. |

<h5 id="ioredis-config">Configuration Options</h5>

| Option | Default | Description |
|------------------|------------------|----------------------------------------|
| service | redis | The service name for this integration. |

<h3 id="koa">koa</h3>

<h5 id="koa-tags">Tags</h5>

| Tag | Description |
|------------------|-----------------------------------------------------------|
| http.url | The complete URL of the request. |
| http.method | The HTTP method of the request. |
| http.status_code | The HTTP status code of the response. |
| http.headers.* | A recorded HTTP header. |

<h5 id="koa-config">Configuration Options</h5>

| Option | Default | Description |
|------------------|---------------------------|----------------------------------------|
| service | *Service name of the app* | The service name for this integration. |
| 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. |
| headers | `[]` | An array of headers to include in the span metadata. |

<h3 id="memcached">memcached</h3>

<h5 id="memcached-tags">Tags</h5>

| Tag | Description |
|------------------|-----------------------------------------------------------|
| memcached.query | The query sent to the server. |
| out.host | The host of the Memcached server. |
| out.port | The port of the Memcached server. |

<h5 id="memcached-config">Configuration Options</h5>

| Option | Default | Description |
|------------------|------------------|----------------------------------------|
| service | memcached | The service name for this integration. |

<h3 id="mongodb-core">mongodb-core</h3>

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

<h3 id="restify">restify</h3>

<h5 id="restify-tags">Tags</h5>

| Tag | Description |
|------------------|-----------------------------------------------------------|
| http.url | The complete URL of the request. |
| http.method | The HTTP method of the request. |
| http.status_code | The HTTP status code of the response. |
| http.headers.* | A recorded HTTP header. |

<h5 id="restify-config">Configuration Options</h5>

| Option | Default | Description |
|------------------|---------------------------|----------------------------------------|
| service | *Service name of the app* | The service name for this integration. |
| 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. |
| headers | `[]` | An array of headers to include in the span metadata. |


<h2 id="advanced-configuration">Advanced Configuration</h2>

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

| Config | Environment Variable | Default | Description |
| ------------- | ---------------------------- | --------- | ----------- |
| enabled | DD_TRACE_ENABLED | true | Whether to enable the tracer. |
| debug | DD_TRACE_DEBUG | false | Enable debug logging in the tracer. |
| service | DD_SERVICE_NAME | | The service name to be used for this program. |
| hostname | DD_TRACE_AGENT_HOSTNAME | localhost | The address of the trace agent that the tracer will submit to. |
Expand Down
9 changes: 9 additions & 0 deletions ext/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

const priority = require('./priority')
const tags = require('./tags')

module.exports = {
priority,
tags
}
8 changes: 8 additions & 0 deletions ext/kinds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict'

module.exports = {
SERVER: 'server',
CLIENT: 'client',
PRODUCER: 'producer',
CONSUMER: 'consumer'
}
8 changes: 8 additions & 0 deletions ext/priority.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict'

module.exports = {
USER_REJECT: -1,
AUTO_REJECT: 0,
AUTO_KEEP: 1,
USER_KEEP: 2
}
17 changes: 17 additions & 0 deletions ext/tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict'

module.exports = {
// Common
SERVICE_NAME: 'service.name',
RESOURCE_NAME: 'resource.name',
SPAN_TYPE: 'span.type',
SPAN_KIND: 'span.kind',
SAMPLING_PRIORITY: 'sampling.priority',
ERROR: 'error',

// HTTP
HTTP_URL: 'http.url',
HTTP_METHOD: 'http.method',
HTTP_STATUS_CODE: 'http.status_code',
HTTP_HEADERS: 'http.headers'
}
5 changes: 5 additions & 0 deletions ext/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

module.exports = {
HTTP: 'http'
}
2 changes: 1 addition & 1 deletion lib/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '0.5.6'
module.exports = '0.6.0'
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dd-trace",
"version": "0.5.6",
"version": "0.6.0",
"description": "Datadog APM tracing client for JavaScript",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -53,6 +53,7 @@
"url-parse": "^1.4.3"
},
"devDependencies": {
"amqp10": "^3.6.0",
"amqplib": "^0.5.2",
"axios": "^0.18.0",
"benchmark": "^2.1.4",
Expand All @@ -73,6 +74,7 @@
"gulp": "^3.9.1",
"gulp-jsdoc3": "^2.0.0",
"jsdoc": "^3.5.5",
"memcached": "^2.2.2",
"mocha": "^5.2.0",
"mongodb-core": "^3.0.7",
"mysql": "^2.15.0",
Expand Down
20 changes: 12 additions & 8 deletions scripts/install_plugin_modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const crypto = require('crypto')
const semver = require('semver')
const exec = require('./helpers/exec')
const plugins = requireDir('../src/plugins')
const externals = require('../test/plugins/externals')

const workspaces = new Set()

Expand All @@ -19,14 +20,17 @@ function run () {
}

function assertVersions () {
Object.keys(plugins).filter(key => key !== 'index').forEach(key => {
[].concat(plugins[key]).forEach(instrumentation => {
[].concat(instrumentation.versions).forEach(version => {
if (version) {
assertModules(instrumentation.name, version)
assertModules(instrumentation.name, semver.coerce(version).version)
}
})
const internals = Object.keys(plugins)
.filter(key => key !== 'index')
.map(key => plugins[key])
.reduce((prev, next) => prev.concat(next), [])

internals.concat(externals).forEach(instrumentation => {
[].concat(instrumentation.versions).forEach(version => {
if (version) {
assertModules(instrumentation.name, version)
assertModules(instrumentation.name, semver.coerce(version).version)
}
})
})
}
Expand Down
Loading

0 comments on commit 6e2be9b

Please sign in to comment.