The agent is configured via a JSON configuration file, which is loaded at startup using the --config=<path> flag.

Inside the config file, you may use ${ENV_NAME} to reference environment variables. The agent will replace these references with the actual environment variable values at runtime. See example below.

$schema

As the agent is in active development, the configuration spec might change frequently and this document could be outdated.

The generated and up to date json schema can be found on GitHub.

Configuration Options

nodeId
string

A unique node id. This is used for identifying the node in the cluster.

Generates a unique id if not provided.

pprof
object

Enable pprof endpoints for profiling.

logging
object

Enable logging to an external sink.

tracing
object

Enable tracing to an external sink.

metrics
object

Enable sending metrics to an external sink.

region
string

The region this agent is running in.

port
string
default: "8080"

Port to listen on.

heartbeat
object

Send heartbeat to a URL.

services
object
required
ratelimit
object
eventRouter
object
vault
object
cluster
object

Run and coordinate multiple agent nodes in a cluster.

Example

Last updated on 2024-07-11
{
  "$schema": "schema.json",
  "platform": "fly",
  "pprof": {
    "username": "${PPROF_USERNAME}",
    "password": "${PPROF_PASSWORD}"
  },
  "image": "${FLY_IMAGE_REF}",
  "nodeId": "node_${FLY_MACHINE_ID}",
  "port": "8080",
  "region": "fly::${FLY_REGION}",
  "logging": {
    "axiom": {
      "dataset": "agent",
      "token": "${AXIOM_TOKEN}"
    }
  },
  "tracing": {
    "axiom": {
      "dataset": "tracing",
      "token": "${AXIOM_TOKEN}"
    }
  },
  "metrics": {
    "axiom": {
      "dataset": "metrics",
      "token": "${AXIOM_TOKEN}"
    }
  },
  "services": {
    "ratelimit": {
      "authToken": "${AUTH_TOKEN}"
    },
    "eventRouter": {
      "authToken": "${AUTH_TOKEN}",
      "tinybird": {
        "token": "${TINYBIRD_TOKEN}",
        "batchSize": 1000,
        "flushInterval": 1,
        "bufferSize": 10000
      }
    },
    "vault": {
      "s3Url": "${VAULT_S3_URL}",
      "s3Bucket": "${VAULT_S3_BUCKET}",
      "s3AccessKeyId": "${VAULT_S3_ACCESS_KEY_ID}",
      "s3AccessKeySecret": "${VAULT_S3_ACCESS_KEY_SECRET}",
      "masterKeys": "${VAULT_MASTER_KEYS}"
    }
  },
  "cluster": {
    "authToken": "${AUTH_TOKEN}",
    "serfAddr": "[${FLY_PRIVATE_IP}]:${SERF_PORT}",
    "rpcAddr": "http://${FLY_PRIVATE_IP}:${RPC_PORT}",
    "join": {
      "dns": {
        "aaaa": "${FLY_APP_NAME}.internal"
      }
    }
  }
}