@madgex/datadog-monitoring
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@madgex/datadog-monitoring", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"dd-trace": "^0.15.3", | ||
"dd-trace": "^0.15.4", | ||
"got": "^9.6.0", | ||
@@ -35,0 +35,0 @@ "hapi-pino": "^6.1.0", |
@@ -17,3 +17,3 @@ # Madgex Datadog Logging and Monitoring | ||
hostname: DD_AGENT_HOSTNAME || '', | ||
service: 'my-service-name, | ||
service: 'my-service-name', | ||
hapiOptions: { | ||
@@ -40,4 +40,22 @@ blacklist: ['/healthcheck'] | ||
All available options for the [dd-trace Hapi plugin](https://datadog.github.io/dd-trace-js/interfaces/plugins.hapi.html) can be passed as `hapiOptions`. Hostname, if not set, will default to the discoverable Datadog agent host on AWS. The hapi-pino plugin should be set up as described in its documentation. | ||
All available options for the [dd-trace Hapi plugin](https://datadog.github.io/dd-trace-js/interfaces/plugins.hapi.html) can be passed as `hapiOptions`. Hostname, if not set, will default to the discoverable Datadog agent host on AWS. The `trace` function returns the tracer instance so further [plugin configuration](https://datadog.github.io/dd-trace-js/modules/plugins.html) can be added if you wish, eg: | ||
```javascript | ||
async function createServer() { | ||
const tracer = await trace({ | ||
hostname: DD_AGENT_HOSTNAME || '', | ||
service: 'my-service-name', | ||
hapiOptions: { | ||
blacklist: ['/healthcheck'] | ||
}, | ||
}); | ||
tracer.use('redis', { analytics: true }); | ||
return server; | ||
} | ||
``` | ||
The hapi-pino plugin should be set up as described in its documentation. | ||
### From the command line | ||
@@ -44,0 +62,0 @@ |
@@ -41,3 +41,3 @@ const dgram = require('dgram'); | ||
if (echo) { | ||
process.stdout.write(result); | ||
console.log(result); | ||
} | ||
@@ -44,0 +44,0 @@ } catch (error) { |
@@ -11,3 +11,3 @@ const tracer = require('dd-trace'); | ||
* @param {string} config.service - your service's name | ||
* @param {string[]} [config.blacklist=[]] - an array of paths you do not want traced, eg. /healthcheck | ||
* @param {Object} config.hapiOptions - options for the dd-trace Hapi plugin | ||
* @returns {TracerProxy} - Datadog tracer | ||
@@ -26,4 +26,5 @@ */ | ||
}); | ||
tracer.use('http', hapiOptions); | ||
tracer.use('hapi', hapiOptions); | ||
return tracer; | ||
}; |
10404
244
68
Updateddd-trace@^0.15.4