npm dd-trace 0.11.0

latest releases: 6.0.0-pre-ca25754, 6.0.0-pre-0f36e48, 5.12.0...
5 years ago

This release includes the beta of Node Runtime Metrics. Currently it has to be enabled by contacting the support team. Please see the documentation for more details.

Features

  • core: add support for forced tracing (#530)
  • core: add support to split object tags as a tag for each property (#498)
  • core: add node runtime metrics as a beta feature (#482)
  • core: add support for unix sockets for agent requests (#479), thanks @lennyburdette!
  • http: add request hook for http client request spans (#529), closes #524

Improvements

  • core: update writer to buffer by payload size instead of by trace count (#499)
  • core: update span.addTags() to accept error objects (#486)

Breaking Changes

HTTP request hooks

The http integration now supports request hooks for both servers and clients. If an existing hook is configured on the shared configuration, it will now apply to both servers and clients.

Depending on your use case, select one of the options below.

Single hook for servers and clients
tracer.use('http', {
  hooks: {
    request: (span, req, res) => {
      // modify the span
    }
  }
})
Different hooks for servers and clients
tracer.use('http', {
  server: {
    hooks: {
      request: (span, req, res) => {
        // modify the span
      }
    }
  },
  client: {
    hooks: {
      request: (span, req, res) => {
        // modify the span
      }
    }
  }
})

span.addTags() now splits objects in multiple tags

Before this release, objects would simply be serialized as a string. In most cases this would result in [object Object] which is undesirable. Using JSON.stringify() would have been an improvement, but would end up adding a tag that is difficult to reason about and use for search & analytics. Instead, objects passed to span.addTags() will now be separated into a individual tags for each property, up to 3 levels of depth.

Before
const obj = {
  foo: 'bar',
  baz: 'qux'
}

span.addTags('test', obj)

// test: [object Object]
After
const obj = {
  foo: 'bar',
  baz: 'qux'
}

span.addTags('test', obj)

// test.foo: bar
// test.baz: qux

Don't miss a new dd-trace release

NewReleases is sending notifications on new releases.