The platform, data_region, and custom_bucket attributes can only be set during creation and cannot be updated later.
Explore documentation
Create a collector
Creates a new Better Stack collector.
Headers
Bearer $TOKEN
Body parameters
A unique name for the collector.
The platform where the collector will be installed. Valid options are docker, swarm, kubernetes, and proxy.
An optional note for the collector.
Required if using a global API token to specify the team that will own the collector.
The data region where the collector's data will be stored. If omitted, the organization's default region is used.
Custom retention period for logs, in days. This is only available on select plans.
Custom retention period for metrics, in days. This is only available on select plans.
Set to true to create the collector in a paused state, preventing it from ingesting data.
The ID of the resource group to assign the collector's associated sources to.
A custom format for messages displayed in live tail, with columns wrapped in {column} brackets.
Example: "PID: {message_json.pid} {level} {message}".
For details, see Live tail docs.
A VRL program to be applied to logs server-side during ingestion.
Configuration for storing data in your own S3-compatible bucket. This is only available on select plans.
A custom Vector configuration in YAML format to be merged with the collector's generated configuration.
An object containing detailed configuration options for the collector.
An object containing settings specific to the proxy platform, such as buffering, SSL/TLS, and HTTP Basic Auth.
An array of database connection objects to be monitored by the collector.
Configuration Object
The configuration object allows for fine-grained control over the collector's behavior.
| Key | Type | Description |
|---|---|---|
components |
object | A flat object of boolean flags to enable or disable specific data collection components. See the Components Object section below for a full list. |
logs_sample_rate |
integer | The percentage (0-100) of logs to sample. |
traces_sample_rate |
integer | The percentage (0-100) of traces to sample. |
vrl_transformation |
string | A VRL program to transform telemetry data on the host before sending. |
disk_batch_size_mb |
integer | The maximum size (in MB) of on-disk batches. Minimum is 256. |
memory_batch_size_mb |
integer | The maximum size (in MB) of in-memory batches. |
when_full |
string | The buffer overflow strategy. Valid options are drop_newest (default) and block. |
services_options |
object | Per-service overrides for log sampling and trace ingestion. |
namespaces_options |
object | Per-namespace overrides for log sampling and trace ingestion (Kubernetes only). |
Components Object
The components object is a flat map of boolean flags to enable or disable specific data collection features.
| Key | Type | Description |
|---|---|---|
ebpf_metrics |
Boolean | Enable eBPF-based metrics collection. |
ebpf_red_metrics |
Boolean | Enable service map and RED (Requests, Error rate, Duration) metrics via eBPF. |
ebpf_tracing_basic |
Boolean | Enable basic eBPF tracing. |
ebpf_tracing_full |
Boolean | Enable full eBPF tracing. |
logs_collector_internals |
Boolean | Collect internal collector logs. |
logs_docker |
Boolean | Collect Docker container logs. |
logs_host |
Boolean | Collect host-level logs. |
logs_kubernetes |
Boolean | Collect Kubernetes logs. |
metrics_apache |
Boolean | Collect Apache metrics. |
metrics_databases |
Boolean | Collect database metrics via the cluster agent. |
metrics_nginx |
Boolean | Collect Nginx metrics. |
traces_opentelemetry |
Boolean | Accept OpenTelemetry SDK traces on ports 4317 (gRPC) and 4318 (HTTP). |
Proxy Configuration Object
The proxy_config object is only applicable when platform is proxy.
| Key | Type | Description |
|---|---|---|
enable_buffering_proxy |
boolean | Enables the collector to act as a buffering proxy. |
buffering_proxy_listen_on |
string | The address and port to listen on (e.g., 0.0.0.0:8080). |
enable_ssl_certificate |
boolean | Enables SSL/TLS termination using a Let's Encrypt certificate. |
ssl_certificate_host |
string | The hostname for the SSL certificate. |
enable_http_basic_auth |
boolean | Enables HTTP Basic Authentication for incoming requests. |
http_basic_auth_username |
string | The username for HTTP Basic Auth. |
http_basic_auth_password |
string | The password for HTTP Basic Auth. This value is write-only and will not be returned in any API response. |
The collector was created successfully.
Response body
Validation failed due to invalid parameters.
Response body
Example: Basic Collector
Example: Collector with Configuration
Example: Proxy Collector with HTTP Basic Auth