Update a collector

Updates an existing collector. Only the provided parameters will be changed.

The platform, data_region, and custom_bucket attributes are immutable and cannot be changed after a collector is created.

PATCH https://telemetry.betterstack.com/api/v1/collectors/{id}

URL parameters

id
required string

Headers

Authorization
required string

Body parameters

name
string
note
string
logs_retention
integer
metrics_retention
integer
ingesting_paused
boolean
source_vrl_transformation
string
user_vector_config
string
configuration
object
proxy_config
object
databases
array

Updating Databases

To manage monitored databases, provide an array to the databases parameter. Each object in the array can either update an existing database (by providing its id) or create a new one (by omitting the id). To delete a database, include its id and set _destroy: true.

Example `databases` payload
{
  "databases": [
    { "id": 1, "host": "updated-db.example.com" },
    { "service_type": "redis", "host": "new-redis.example.com", "port": 6379 },
    { "id": 2, "_destroy": true }
  ]
}
200

Response body

{
  "data": {
    "id": "1",
    "type": "collector",
    "attributes": {
      "name": "Renamed Collector",
      "platform": "docker",
      "note": "This note has been updated.",
      "status": "online",
      "secret": "collector-secret-goes-here",
      "team_id": 123,
      "team_name": "My Team",
      "data_region": "a3",
      "logs_retention": 60,
      "metrics_retention": 180,
      "configuration": {
        "components": {
          "logs_docker": true
        },
        "logs_sample_rate": 50,
        "traces_sample_rate": 100,
        "vrl_transformation": null,
        "disk_batch_size_mb": 256,
        "memory_batch_size_mb": 10,
        "when_full": "drop_newest"
      },
      "proxy_config": null,
      "user_vector_config": null,
      "ingesting_paused": false,
      "source_vrl_transformation": null,
      "pinged_at": "2023-10-27T10:00:00.000Z",
      "created_at": "2023-10-26T10:00:00.000Z",
      "updated_at": "2023-10-28T14:00:00.000Z",
      "custom_bucket": null
    }
  }
}
404
422

Response body

{
  "errors": [
    "Data region can't be changed. Create a new collector to change your data region."
  ],
  "invalid_attributes": [
    "data_region"
  ]
}

Example Request

cURL
curl -X PATCH "https://telemetry.betterstack.com/api/v1/collectors/1" \
     -H "Authorization: Bearer $TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "note": "Updated note for production collector.",
       "configuration": {
         "logs_sample_rate": 50
       }
     }'