# Configuration Guide This document describes the current configuration model used by `xburner`. `parseFile` also supports a file-level directive: ```toml include = "./common.toml" env_file = "./.env" ``` Included files are expanded before parsing. Relative paths are resolved from the including file. `env_file` entries are loaded before placeholder resolution. Values from `env_file` override process environment variables with the same key. ## Sections An `xburner` config is split into the following sections: - `[scenario]` - `[execution]` - `[[execution.stages]]` - `[http]` - `[plugins]` - `[[setup.requests]]` - `[http.defaults]` - `[http.defaults.tls]` - `[exporters.otlp]` - `[[exporters.plugins]]` - `[[http.requests]]` - `[[thresholds]]` ## `[scenario]` Fields: - `name` - `protocol` - `target` - `wasm` - `wasm_backend` - `recovery.window` - `recovery.max_recreates` Notes: - omit `wasm` for `simple` mode - set `wasm` for `workflow` mode - `wasm_backend` defaults to `wamr` - `wasm_backend` may be `wamr` or `wasm3` - `recovery.window` defaults to `5s` - `recovery.max_recreates` defaults to `3` ## `[execution]` Fields: - `mode` - `duration` - `warmup` - `setup_timeout` - `shutdown_timeout` - `vus` - `rate` - `pre_allocated_vus` - `max_vus` - `script_timeout` - `max_poisoned_workers` - `thread_count` Modes: - `constant-vus` - `constant-arrival-rate` - `ramping-vus` `ramping-vus` uses `[[execution.stages]]` instead of `vus` / `rate`. Defaults: - `warmup = "0s"` - `script_timeout = "100ms"` - `setup_timeout = "5s"` - `shutdown_timeout = "30s"` - `max_poisoned_workers = 0` - `thread_count = CPU core count` Notes: - `thread_count` is currently used by the multithreaded `simple` + `constant-vus` runner - other execution modes currently keep the single-thread path even when `thread_count` is set ## `[[execution.stages]]` Supported fields: - `target_vus` - `duration` Rules: - each stage `duration` must be positive ## `[http]` Supported fields: - `version` - `max_connections` - `transport_plugin` Defaults: - `version = "1.1"` - `max_connections` is unset, which means no pool cap - `transport_plugin` is unset Notes: - `version` may be `auto`, `1.1`, or `2` - `transport_plugin` requires `[plugins].dir` - `auto` currently uses ALPN over TLS and falls back to HTTP/1.1 when the server does not negotiate HTTP/2 - `2` currently requires TLS targets - this limit applies to the manual TLS keep-alive pool - when the pool is full, the oldest idle connection is evicted before a new one is opened ## `[plugins]` Supported fields: - `dir` Defaults: - `dir` is unset Notes: - `dir` points to a filesystem directory containing plugin manifest JSON files - transport or exporter plugins require this directory to be configured ## `[[setup.requests]]` Setup requests run before measurement starts. Supported fields: - `name` - `method` - `path` - `headers` - `body` - `store_body_as` - `timeout_ms` - `capture_body_max_bytes` Rules: - `store_body_as` must use the `setup.*` namespace Defaults: - `body` is omitted by default - `store_body_as` is omitted by default - `timeout_ms = 0`, which falls back to `execution.setup_timeout` - `capture_body_max_bytes = 0` ## `[http.defaults]` Supported fields: - `use_tls` - `cookie_jar` - `cookie_jar_scope` - `max_steps_per_iteration` - `headers` - `connect_timeout_ms` - `timeout_ms` - `delay_before_ms` - `pass_response_body` - `capture_body_max_bytes` Defaults: - `use_tls = false` - `cookie_jar = true` - `cookie_jar_scope = "vu"` - `max_steps_per_iteration = 16` - `headers = {}` - `connect_timeout_ms = 0` - `timeout_ms = 0` - `delay_before_ms = 0` - `pass_response_body = false` - `capture_body_max_bytes = 0` `cookie_jar_scope` may be: - `vu` - `iteration` Request-level settings inherit these defaults when the request does not set its own value. Default headers are merged into each request, and request headers override default headers by key. `connect_timeout_ms` applies to the manual transport paths. Plain HTTP requests use a one-shot manual path when this setting is enabled, and HTTPS requests switch to the manual TLS path so the connect timeout can be enforced explicitly. For `protocol = "grpc"`, the same request schema is reused as unary RPC metadata/body config. gRPC requests must use `method = "POST"` and `cookie_jar = false`. ## `[http.defaults.tls]` Supported fields: - `ca_file` - `server_name` - `insecure_skip_verify` Defaults: - `ca_file` is unset - `server_name` is unset - `insecure_skip_verify = false` ## `[[http.requests]]` Request templates are used directly by `simple` mode and referenced by `workflow` mode via `request_id`. For `protocol = "grpc"`, `path` is the RPC path and `headers` are sent as gRPC metadata. Supported fields: - `id` - `name` - `method` - `path` - `headers` - `connect_timeout_ms` - `body` - `timeout_ms` - `delay_before_ms` - `pass_response_body` - `capture_body_max_bytes` - `check_status_code` - `check_body_contains` - `check_response_header` Defaults: - request-level `connect_timeout_ms`, `timeout_ms`, `delay_before_ms`, `pass_response_body`, and `capture_body_max_bytes` inherit from `[http.defaults]` - `body` is omitted by default - `headers = {}` before default-header merge - built-in checks are disabled by default ## `[[exporters.plugins]]` Supported fields: - `name` - `config` Defaults: - `config = {}` Notes: - `name` resolves against manifest files found under `[plugins].dir` - `config` is passed to the plugin as a string key/value map - `samples/plugins/csv` contains a sample CSV exporter plugin manifest and script Notes: - `check_status_code` compares the received HTTP status code - `check_body_contains` searches the captured response body for a substring - `check_response_header` checks header presence by case-insensitive name - enabling `check_body_contains` auto-enables host body capture even when `capture_body_max_bytes` is otherwise `0` ## `[exporters.otlp]` Supported fields: - `url` - `retry_max_attempts` - `retry_max_elapsed` - `buffer_max_exports` Defaults: - `retry_max_attempts = 4` - `retry_max_elapsed = "30s"` - `buffer_max_exports = 8` Notes: - exporter failures are logged but do not change the run exit code - failed batches stay buffered in memory and are retried on the next export attempt ## `[[thresholds]]` Fields: - `metric` - `scope` - `op` - `value` - `abort_on_fail` ## Threshold Metrics Currently supported: - `http.request.duration.p50` - `http.request.duration.p90` - `http.request.duration.p99` - `http.error_rate` - `http.transport.error_total` - `http.transport.error_rate` - `http.transport.timeout_total` - `http.transport.timeout_rate` - `http.transport.connect_timeout_total` - `http.transport.connect_timeout_rate` - `http.transport.io_timeout_total` - `http.transport.io_timeout_rate` - `check.failed_total` - `check.pass_rate` - `executor.scheduler_lag.avg` - `executor.scheduler_lag.max` - `iteration.dropped` - `iteration.success_rate` ## Threshold Scopes Examples: ```toml scope = { request = "login" } scope = { scenario = "workflow-health" } scope = { protocol = "http" } ``` Rules: - request-scoped thresholds apply only to request metrics - scenario scope must match the scenario name in the same config - protocol scope must match the scenario protocol in the same config ## Backend Override The workflow backend may also be overridden from the CLI: ```sh xburner validate --wasm-backend wasm3 path/to/scenario.toml xburner run --wasm-backend wamr path/to/scenario.toml ``` ## Samples See: - [samples/simple-healthcheck.toml](../samples/simple-healthcheck.toml) - [samples/simple-grpc-echo.toml](../samples/simple-grpc-echo.toml) - [samples/distributed-healthcheck.toml](../samples/distributed-healthcheck.toml) - [samples/plugin-csv-healthcheck.toml](../samples/plugin-csv-healthcheck.toml) - [samples/workflow-health.toml](../samples/workflow-health.toml) - [samples/workflow-grpc-echo.toml](../samples/workflow-grpc-echo.toml) - [samples/workflow-setup.toml](../samples/workflow-setup.toml)