Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datadog-tracer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datadog-tracer

OpenTracing Tracer implementation for Datadog in JavaScript

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
209
increased by25.15%
Maintainers
1
Weekly downloads
 
Created
Source

Datadog Tracer

npm Build Status codecov Code Climate bitHound Dependencies

OpenTracing tracer implementation for Datadog in JavaScript. It is intended for use both on the server and (soon) in the browser.

Installation

NodeJS

npm install --save datadog-tracer

Node >= 4 is required.

Browser

Not yet supported

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

var express = require('express')
var Tracer = require('datadog-tracer')

var tracer = new Tracer({ service: 'my service' })

// handle errors from Datadog agent. omit this if you want to ignore errors
tracer.on('error', function (e) {
  console.log(e)
})

var app = express()

app.get('/user/:id', function (req, res) {
  var span = tracer.startSpan('someOperation')

  // do stuff

  span.addTags({
    'resource': '/user/:id', // required by Datadog
    'type': 'web', // required by Datadog
    'span.kind': 'server',
    'http.method': 'GET',
    'http.url': '/user/123',
    'http.status_code': '200'
  })
  span.finish()
  
  res.send()
})

See the semantic conventions for more information about tags.

API Documentation

See the OpenTracing JavaScript API

Keywords

FAQs

Package last updated on 20 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc