Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

4.7 KB
Raw Blame
# Beacon Endpoint Agent -> Asymptote managed ingest
#
# Vector tails Beacon's local JSONL streams and POSTs them, gzip-compressed and
# newline-delimited, to the Asymptote ingest service with a per-device key.
# The key is read from a 0600 JSON file through Vector's secret backend so it
# appears in neither this config nor the process environment.
#
# Required environment:
#   BEACON_ASYMPTOTE_INGEST_URL    https URL returned by device enrollment
#   BEACON_ASYMPTOTE_SECRETS_FILE  path to a {"device_key": "<device key>"} file (mode 0600)
# Optional:
#   BEACON_ASYMPTOTE_DATA_DIR      Vector data_dir for checkpoints and the disk buffer
#
# `beacon endpoint connect` writes this file with the values filled in and runs
# Vector as a service; this template is for running the same forwarder by hand.

data_dir = "${BEACON_ASYMPTOTE_DATA_DIR:-/var/lib/vector/beacon-asymptote}"

[secret.beacon]
type = "file"
path = "${BEACON_ASYMPTOTE_SECRETS_FILE}"

[sources.beacon_runtime]
type = "file"
# The first rotated file too, as the Sentinel pack reads it. Vector recognizes a file by its first
# line, so when the log is replaced by a copy (switching to restricted log access does) it keeps
# reading the replaced file until it restarts or the log rotates. At the rotation it finds its file
# again as the .1, reopens it and resumes at its checkpoint, so the lines written in between ship
# instead of being lost. A rotated file it was already reading is the same file to Vector, so
# nothing is read twice.
include = ["{{LOG_PATH}}", "{{LOG_PATH}}.1"]
# Nothing recorded before the device was approved is shipped.
read_from = "end"

# The bounded session backfill every connect stages from the agents' own
# session stores, so the dashboard shows recent history at once. Each connect
# replaces the file atomically; fingerprinting by inode makes every restaged
# copy a new file read from the beginning, where a content checksum could take
# a restaged copy that starts with the same event for the old one and resume
# at a stale offset. Lines already shipped carry the same event.id as before.
[sources.beacon_backfill]
type = "file"
include = ["{{BACKFILL_LOG_PATH}}"]
read_from = "beginning"
fingerprint.strategy = "device_and_inode"

[sources.beacon_inventory]
type = "file"
include = ["{{INVENTORY_LOG_PATH}}"]
read_from = "beginning"

# BEACON_PRIVACY_TRANSFORMS

[sinks.asymptote_runtime]
type = "http"
inputs = ["beacon_runtime", "beacon_backfill"]
uri = "${BEACON_ASYMPTOTE_INGEST_URL}/v1/ingest/runtime"
method = "post"
compression = "gzip"

[sinks.asymptote_runtime.auth]
strategy = "bearer"
token = "SECRET[beacon.device_key]"

[sinks.asymptote_runtime.encoding]
codec = "text"

[sinks.asymptote_runtime.framing]
method = "newline_delimited"

[sinks.asymptote_runtime.request.headers]
Content-Type = "application/x-ndjson"

[sinks.asymptote_runtime.batch]
# Stays under the ingest service's 8 MiB compressed / 10,000 line limits. A
# short window puts a new user's first sessions on the dashboard within seconds
# of connecting; a busy device still fills batches by size.
max_bytes = 5000000
max_events = 5000
timeout_secs = 10

[sinks.asymptote_runtime.buffer]
# Survives offline periods and forwarder restarts; drains on reconnect.
type = "disk"
max_size = 536870912
when_full = "block"

[sinks.asymptote_runtime.request]
timeout_secs = 30
retry_initial_backoff_secs = 2
retry_max_duration_secs = 300
# At most one request a second, the rate the ingest service allows each
# device. A backfill or a backlog drained after an offline period is sent in
# full batches at that pace instead of tripping 429s.
rate_limit_num = 1
rate_limit_duration_secs = 1

# The healthcheck carries the bearer key, so a revoked or expired device shows up
# as an unhealthy sink at startup (401) instead of silently dropping batches.
[sinks.asymptote_runtime.healthcheck]
uri = "${BEACON_ASYMPTOTE_INGEST_URL}/v1/ingest/health"

[sinks.asymptote_inventory]
type = "http"
inputs = ["beacon_inventory"]
uri = "${BEACON_ASYMPTOTE_INGEST_URL}/v1/ingest/inventory"
method = "post"
compression = "gzip"

[sinks.asymptote_inventory.auth]
strategy = "bearer"
token = "SECRET[beacon.device_key]"

[sinks.asymptote_inventory.encoding]
codec = "text"

[sinks.asymptote_inventory.framing]
method = "newline_delimited"

[sinks.asymptote_inventory.request.headers]
Content-Type = "application/x-ndjson"

[sinks.asymptote_inventory.batch]
max_bytes = 5000000
max_events = 5000
timeout_secs = 60

[sinks.asymptote_inventory.buffer]
type = "disk"
max_size = 268435488
when_full = "block"

[sinks.asymptote_inventory.request]
timeout_secs = 30
retry_initial_backoff_secs = 2
retry_max_duration_secs = 300

[sinks.asymptote_inventory.healthcheck]
uri = "${BEACON_ASYMPTOTE_INGEST_URL}/v1/ingest/health"