Datadog Tracer
dd-trace-js has now been released.
DEPRECATED: The official libraryOpenTracing tracer implementation for Datadog in JavaScript. It is intended for use both on the server and in the browser.
Installation
NodeJS
npm install --save datadog-tracer
Node >= 4 is required.
Browser
The library supports CommonJS and AMD loaders and also exports globally as DatadogTracer
.
NOTE: If you want to use binary propagation, make sure to also include the minimal version of protobuf.js before this library.
CDN
NOTE: Remember to replace the version tag with the exact release your project depends upon.
Frontend
Usage
See the OpenTracing JavaScript documentation for more information.
Custom tracer options
- service: name of the Datadog service
- hostname: hostname of the Datadog agent (default: localhost)
- port: port of the Datadog agent (default: 8126)
- protocol: protocol of the Datadog agent (default: http)
- endpoint: full URL of the Datadog agent (alternative to hostname+port+protocol)
Example
const express = const Tracer = const app = const tracer = service: 'example' // handle errors from Datadog agent. omit this if you want to ignore errorstracer app app
See the examples folder for more advanced examples.
API Documentation
See the OpenTracing JavaScript API