Configuration Reference
Tusk Drift can be configured through multiple methods with the following precedence (highest to lowest):- Environment Variables: secrets, as well as common CI settings,
- Initialization Parameters via
initialize(), - Config override file via
--config-overrideflag orTUSK_CONFIG_OVERRIDEenv var, - YAML Configuration in
.tusk/config.yaml, mostly set-and-forget static project settings
.tusk/config.yaml is created in your project root when you run tusk init.
This document is structured as follows: the yaml configuration fields are listed
out according to their parent and their path. You can directly use these field
names in your config. This is followed by env vars and other options that are
only available as env vars or arguments.
Some settings have more specific precedence rules than the general list above.
For example, sampling-rate init params override sampling-rate environment
variables. Each section below calls out the exact override behavior where it
matters.
Config Overrides
You can provide a config override file that is merged on top of the base config. Only the fields you specify in the override file are changed; everything else is preserved from the base config. This is useful for local-only settings like disabling span export or changing the sampling mode without modifying the shared config file. Using the--config-override flag:
TUSK_CONFIG_OVERRIDE env var:
--config-override flag takes precedence over the TUSK_CONFIG_OVERRIDE
env var. Both are overridden by individual environment variables.
Example override file:
.tusk/local-config.yaml
service
Configuration related to your service identity and startup.
service.id
| Type | Required | Default | Example |
|---|---|---|---|
string (UUID) | Yes* | - | "d7fd9519-3151-4638-b59d-8da8f6d63514" |
export_spans: true
Unique identifier for your service in Tusk Cloud. Used to associate traces with
your specific service.
service.name
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "unknown" | "my-service" |
service.port
| Type | Required | Default | Example |
|---|---|---|---|
number | No | - | 8080 |
service.start.command
| Type | Required | Default | Example |
|---|---|---|---|
string | No | - | "npm start" |
tusk run to start your service. Should NOT include
TUSK_DRIFT_MODE environment variable.
service.readiness_check
Configuration for verifying service is ready to accept requests.
service.readiness_check.command
| Type | Required | Default | Example |
|---|---|---|---|
string | No | - | "curl -f http://localhost:8080/health" |
mark_app_as_ready before this
endpoint’s first successful response.
service.readiness_check.timeout
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "45s" | "30s" |
service.readiness_check.interval
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "5s" | "2s" |
Sampling
Tusk Drift supports both fixed sampling and adaptive sampling. In adaptive mode, the SDK starts from a configured base rate and can temporarily reduce recording under local pressure such as exporter backlog or runtime memory pressure.recording.sampling.mode
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "fixed" | "adaptive" |
fixed and adaptive.
- Can be set via environment variable:
TUSK_RECORDING_SAMPLING_MODE
recording.sampling.base_rate
| Type | Required | Default | Example |
|---|---|---|---|
number (0.0-1.0) | No | 1.0 | 0.1 |
fixed
mode this is the effective rate. In adaptive mode the SDK may temporarily
reduce below this base rate under pressure.
- Can be set via environment variable:
TUSK_RECORDING_SAMPLING_RATE - Legacy environment variable alias:
TUSK_SAMPLING_RATE - Can be set via initialization parameter:
samplingRate
recording.sampling.min_rate
| Type | Required | Default | Example |
|---|---|---|---|
number (0.0-1.0) | No | 0.001 in adaptive mode, unset otherwise | 0.01 |
adaptive mode.
recording.sampling.log_transitions
| Type | Required | Default | Example |
|---|---|---|---|
boolean | No | true | false |
Adaptive sampling updated (...). Only relevant in adaptive mode.
- Can be set via environment variable:
TUSK_RECORDING_SAMPLING_LOG_TRANSITIONS
recording.sampling_rate
| Type | Required | Default | Example |
|---|---|---|---|
number (0.0-1.0) | No | - | 0.5 |
recording.sampling.base_rate. Still supported for
backward compatibility.
traces
traces.dir
| Type | Required | Default | Example |
|---|---|---|---|
string | No | ".tusk/traces" | ".tusk/traces" |
recording
recording.export_spans
| Type | Required | Default | Example |
|---|---|---|---|
boolean | No | false | true |
false, spans are stored
locally only.
- Can be set via environment variable:
TUSK_RECORDING_EXPORT_SPANS
test_execution
test_execution.concurrency
| Type | Required | Default | Example |
|---|---|---|---|
number | No | 10 | 5 |
test_execution.timeout
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "30s" | "60s" |
comparison
comparison.ignore_fields
| Type | Required | Default | Example |
|---|---|---|---|
string[] | No | - | ["timestamp", "requestId"] |
recording
recording.enable_env_var_recording
| Type | Required | Default | Example |
|---|---|---|---|
boolean | No | false | true |
- Can be set via environment variable:
TUSK_ENABLE_ENV_VAR_RECORDING
recording.enable_analytics
| Type | Required | Default | Example |
|---|---|---|---|
boolean | No | false | true |
recording.exclude_paths
| Type | Required | Default | Example |
|---|---|---|---|
string[] | No | - | ["/health", "/metrics"] |
tusk_api
tusk_api.url
| Type | Required | Default | Example |
|---|---|---|---|
string (URL) | No | Tusk cloud URL | "http://localhost:8000" |
- Can be set via environment variable:
TUSK_API_URL
tusk_api.auth0_domain
| Type | Required | Default | Example |
|---|---|---|---|
string | No | Tusk cloud Auth0 URL | "tusk.dev.auth0.com" |
- Can be set via environment variable:
TUSK_AUTH0_DOMAIN
tusk_api.auth0_client_id
| Type | Required | Default | Example |
|---|---|---|---|
string | No | Tusk cloud client id | "TxwUtpScbKam4xGWcGEEMLpwlpeECJS5" |
- Can be set via environment variable:
TUSK_AUTH0_CLIENT_ID
CLI Communication (Replay Mode)
TUSK_MOCK_SOCKET (Unix Socket)
| Type | Required | Default | Example |
|---|---|---|---|
string | No | /tmp/tusk-connect.sock | /tmp/tusk-connect.sock |
- Can be set via environment variable:
TUSK_MOCK_SOCKET
TUSK_MOCK_HOST / TUSK_MOCK_PORT (TCP)
| Type | Required | Default | Example |
|---|---|---|---|
string, string | No | - | - |
- Can be set via environment variables:
TUSK_MOCK_HOST,TUSK_MOCK_PORT
Operation Mode
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "DISABLED" | "RECORD" |
- Can be set via environment variable:
TUSK_DRIFT_MODE
"RECORD": Records traces for all instrumented operations (use in staging/production)"REPLAY": Replays previously recorded traces (automatically set bytusk run, do NOT set manually!). This will disable instrumented packages’ egress traffic."DISABLED": Disables all instrumentation
API Key
| Type | Required | Default | Example |
|---|---|---|---|
string | Yes* | - | "td_1234567890abcdef" |
export_spans: true
Your Tusk Drift API key for authenticating with Tusk Cloud services. Note:
This is a confidential value and should only be provided via environment
variable or initialization parameter, not in YAML configuration.
- Can be set via initialization parameter:
apiKey
Environment
| Type | Required | Default | Example |
|---|---|---|---|
string | No | "development" | "production" |
- If not provided,
NODE_ENVis used as default - Can be set via initialization parameter:
env
Logging
| Type | Required | Default | Example |
|---|---|---|---|
string | No | 'info' | 'debug' |
- Can be set via initialization parameter:
logLevel
'silent', 'error', 'warn', 'info', 'debug'
Transforms Configuration
transforms
| Type | Required | Default | Example |
|---|---|---|---|
TransformConfigs | No | - | - |
- Can be set via initialization parameter:
transforms
Complete Configuration Example
.tusk/config.yaml