Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TracerOptions

List of options available to the tracer.

Hierarchy

  • TracerOptions

Index

Properties

Optional analytics

analytics: boolean

Enable Trace Analytics.

default

false

Optional clientToken

clientToken: string

Client token for browser tracing. Can be generated in the UI at Integrations -> APIs.

Optional debug

debug: boolean

Enable debug logging in the tracer.

default

false

Optional dogstatsd

dogstatsd: object

Options specific for the Dogstatsd agent.

Type declaration

  • Optional port?: number

    The port of the Dogstatsd agent that the metrics will submitted to.

    default

    8125

Optional enabled

enabled: boolean

Whether to enable the tracer.

default

true

Optional env

env: string

Set an application’s environment e.g. prod, pre-prod, stage.

Optional experimental

experimental: boolean | object

Experimental features can be enabled all at once by using true or individually using key / value pairs.

default

{}

Optional flushInterval

flushInterval: number

Interval in milliseconds at which the tracer will submit traces to the agent.

default

2000

Optional hostname

hostname: string

The address of the trace agent that the tracer will submit to.

default

'localhost'

Optional logInjection

logInjection: boolean

Whether to enable trace ID injection in log records to be able to correlate traces with logs.

default

false

Optional logLevel

logLevel: "error" | "debug"

A string representing the minimum tracer log level to use when debug logging is enabled

default

'debug'

Optional logger

logger: object

Custom logger to be used by the tracer (if debug = true), should support debug() and error() methods see https://datadog.github.io/dd-trace-js/#custom-logging

Type declaration

  • debug: function
      • (message: string): void
      • Parameters

        • message: string

        Returns void

  • error: function
      • (err: Error | string): void
      • Parameters

        • err: Error | string

        Returns void

Optional plugins

plugins: boolean

Whether to load all built-in plugins.

default

true

Optional port

port: number | string

The port of the trace agent that the tracer will submit to.

default

8126

Optional reportHostname

reportHostname: boolean

Whether to report the hostname of the service host. This is used when the agent is deployed on a different host and cannot determine the hostname automatically.

default

false

Optional runtimeMetrics

runtimeMetrics: boolean

Whether to enable runtime metrics.

default

false

Optional sampleRate

sampleRate: number

Percentage of spans to sample as a float between 0 and 1.

default

1

Optional scope

scope: "async_hooks" | "noop"

Specifies which scope implementation to use. The default is to use the best implementation for the runtime. Only change this if you know what you are doing.

Optional service

service: string

The service name to be used for this program. If not set, the service name will attempted to be inferred from package.json

Optional tags

tags: object

Global tags that should be assigned to every span.

Type declaration

  • [key: string]: any

Optional trackAsyncScope

trackAsyncScope: boolean

Whether to track the scope of async functions. This is needed for async/await to work with non-native promises (thenables). Only disable this if you are sure only native promises are used with async/await.

default

true

Optional url

url: string

The url of the trace agent that the tracer will submit to. Takes priority over hostname and port, if set.

Generated using TypeDoc