Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TracerOptions

List of options available to the tracer.

Hierarchy

  • TracerOptions

Index

Properties

Optional analytics

analytics: undefined | false | true

Enable Trace Analytics.

default

false

Optional clientToken

clientToken: undefined | string

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

Optional debug

debug: undefined | false | true

Enable debug logging in the tracer.

default

false

Optional dogstatsd

dogstatsd: undefined | { hostname?: undefined | string; port?: undefined | number }

Options specific for the Dogstatsd agent.

Optional enabled

enabled: undefined | false | true

Whether to enable the tracer.

default

true

Optional env

env: undefined | string

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

Optional experimental

experimental: boolean | { b3?: undefined | false | true; distributedTracingOriginAllowlist?: (string | RegExp)[]; enableGetRumData?: undefined | false | true; exporter?: "log" | "browser" | "agent"; internalErrors?: undefined | false | true; runtimeId?: undefined | false | true; sampler?: undefined | { rateLimit?: Number; rules?: SamplingRule[]; sampleRate?: Number } }

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

default

{}

Optional flushInterval

flushInterval: undefined | number

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

default

2000

Optional hostname

hostname: undefined | string

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

default

'localhost'

Optional ingestion

ingestion: undefined | { rateLimit?: undefined | number; sampleRate?: undefined | number }

Configuration of the ingestion between the agent and the backend.

Optional logInjection

logInjection: undefined | false | true

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: undefined | { debug: (message: string) => void; error: (err: Error | string) => void; info: (message: string) => void; warn: (message: string) => void }

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

Optional lookup

lookup: LookupFunction

Custom function for DNS lookups when sending requests to the agent.

default

dns.lookup()

Optional orphanable

orphanable: undefined | false | true

If false, require a parent in order to trace.

default

true

Optional plugins

plugins: undefined | false | true

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 protocolVersion

protocolVersion: undefined | string

Protocol version to use for requests to the agent. The version configured must be supported by the agent version installed or all traces will be dropped.

default

0.4

Optional reportHostname

reportHostname: undefined | false | true

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: undefined | false | true

Whether to enable runtime metrics.

default

false

Optional sampleRate

sampleRate: undefined | number

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

default

1

Optional scope

scope: "async_hooks" | "async_local_storage" | "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: undefined | 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 startupLogs

startupLogs: undefined | false | true

Whether to enable startup logs.

default

true

Optional tags

tags: undefined | {}

Global tags that should be assigned to every span.

Optional trackAsyncScope

trackAsyncScope: undefined | false | true

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, or if you are using Node >=14.5 since the issue has been fixed in that version.

default

true

Optional url

url: undefined | string

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

Optional version

version: undefined | string

The version number of the application. If not set, the version will attempted to be inferred from package.json.

Generated using TypeDoc