Installation
Install and configure the Foxglove Agent.
System requirements
You will need:
- HTTPS access to
api.foxglove.dev
(stable connection not required) - A filesystem supporting
fsnotify
for recordings storage - For self-hosted deployments: network access to your Primary Site's inbox bucket
Create a device and token
- Go to the Devices page to create or select a device
- Have an admin generate a secret token from the device's "Device Tokens" tab
Admins can also create device tokens via API. Generate an API key with deviceToken
capabilities from the API key settings page and use it to create device tokens.
Each Agent installation requires its own unique device and device token. Multi-compute robots sharing a single device aren't supported.
Install the Agent
Foxglove Agent is available for installation in these forms:
- A
.deb
package, for Debian-based Linux distributions - A statically-linked Linux executable
- A Docker image
Debian packages and executables can be downloaded from the releases page for AMD64 and ARM64 architectures. To upgrade the package, check the releases page for newer release versions to download.
Using Docker
A multi-platform Docker image is available at us-central1-docker.pkg.dev/foxglove-images/images/agent
.
The Agent needs a writable directory to store its own persistent state. This must be mounted inside the container at /index
. You can use a Docker Volume to manage this state:
docker volume create foxglove-agent-index-storage
docker run \
--mount type=volume,src=foxglove-agent-index-storage,dst=/index \
--mount type=bind,src=/path/to/recording/storage,dst=/storage \
--env-file your-agent-config.env \
us-central1-docker.pkg.dev/foxglove-images/images/agent:0.0.0 # replace with a valid release version number
From the Debian package
Download the latest foxglove-agent
package for your architecture from the releases page. Install with dpkg
:
# replace with downloaded filename
dpkg -i foxglove-agent_0.0.0_amd64.deb
Configure the Agent
The following instructions explain how to set environment variables for the Agent. Where you set these depends on your installation method:
- When using the
.deb
package, the Agent's environment is configured in/etc/foxglove/agent/envfile
. - When using the standalone executable, you manage the process environment directly.
- When using the Docker image, you pass environment values into the container using
--env
or--env-file
.
Configure device identity
The agent is associated with a device using the FOXGLOVE_DEVICE_TOKEN
environment variable, which should be set to the secret device token generated above.
A device should have at most one agent at any given time.
Changing device identity
If an agent is reconfigured with a new device token which refers to a new device, the agent will fail to initialize with an error message: conflicting local device identity: {device-name} ({device-id})
.
This is a safeguard to prevent misconfiguration.
If the change in identity is intentional, you will need to delete the agent's local database ($VARDIR/controller.db
).
Configure storage directory
When using the .deb
package or standalone executable, configure the STORAGE_ROOT
environment variable with the directory you want to monitor for newly recorded data files. This will serve as the Agent's data directory.
When using the Agent Docker image, bind-mount your data directory to /storage
inside the container. You do not need to configure STORAGE_ROOT
.
Configure recording filters
By default, the agent will attempt to read any file under STORAGE_ROOT
as a recording, unless the file ends in .active
or .json
.
For multipurpose storage directories, this will generate a large volume of repetitive log messages indicating that various files cannot be parsed as recordings.
Most users will want to override this behavior with WATCH_INCLUDE_SUFFIXES
, which is a comma-delimited list of file suffixes that the agent should treat as recordings.
A setting of WATCH_INCLUDE_SUFFIXES=.bag,.mcap
is a reasonable choice.
More granular filtering can be accomplished through the following variables:
WATCH_EXCLUDE_REGEX
: A regex of paths the agent should ignoreWATCH_EXCLUDE_SUFFIXES
: A comma-delimited list of suffixes the agent should ignoreWATCH_INCLUDE_REGEX
: A regex of paths that the agent should treat as recordings
If a combination of these variables are used, the agent will treat a file as a recording if and only if it matches all of the include filters and none of the exclude filters.
Upload settings
Choose your upload configuration:
- Foxglove-hosted
- Self-hosted
By default, your Organization will be configured with a Foxglove-hosted Primary Site. No additional configuration is required in this case.
If your Foxglove organization uses a self-hosted (self-managed) Primary Site, your device will need credentials to upload recordings, depending on the cloud service hosting your Primary Site inbox bucket.
- Google Cloud Storage
- Azure
- AWS
- S3-compatible
First, install a credentials.json
file into the device filesystem that authorizes the agent to write into your inbox bucket.
When installing using the .deb
package, The foxglove
user must have permissions to read this file.
When using the Docker image, the credentials.json
file must be mounted into the container filesystem.
Configure the following environment variables:
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=google_cloud
# Must be set to a valid bucket name, excluding any `gs://` scheme
INBOX_BUCKET_NAME=...
# Set this to the absolute path of the credentials.json file
# If using Docker, use the path inside the container, not the host filesystem path
GOOGLE_APPLICATION_CREDENTIALS=...
Configure the following environment variables:
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=azure
# Must be set to a valid bucket name
INBOX_BUCKET_NAME=...
# Set these according to your Azure deployment
AZURE_TENANT_ID=...
AZURE_CLIENT_ID=...
AZURE_CLIENT_SECRET=...
AZURE_STORAGE_ACCOUNT_NAME=...
# Optional: Override for storage endpoint.
#AZURE_STORAGE_ENDPOINT=https://{account}.blob.core.windows.net
Note that the following configuration variables have been renamed in v1.3.0.
AZURE_INBOX_STORAGE_ACCOUNT_NAME
is nowAZURE_STORAGE_ACCOUNT_NAME
AZURE_INBOX_STORAGE_SERVICE_URL
is nowAZURE_STORAGE_ENDPOINT
The old variables still work, but users are encouraged to switch to the new names.
Configure the following environment variables:
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=aws
# Must be set to a valid bucket name
INBOX_BUCKET_NAME=...
# Set these according to your AWS deployment
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_DEFAULT_REGION=...
# Optional: Enable SHA-256 checksum-on-upload.
#AWS_UPLOAD_CHECKSUM=sha256
If your Primary Site inbox bucket uses a S3-compatible service like MinIO, configure the following environment variables:
PRIMARY_SITE_MODE=self-managed
INBOX_STORAGE_PROVIDER=s3_compatible
# Set these according to your S3-compatible service deployment
S3_COMPATIBLE_ACCESS_KEY_ID=...
S3_COMPATIBLE_SECRET_ACCESS_KEY=...
S3_COMPATIBLE_SERVICE_REGION=...
S3_COMPATIBLE_SERVICE_URL=...
# Optional: Enable SHA-256 checksum-on-upload.
#S3_COMPATIBLE_UPLOAD_CHECKSUM=sha256
Note that the following configuration variables have been renamed in v1.3.0.
RECORDING_STORAGE_S3_COMPATIBLE_ACCESS_KEY_ID
is nowS3_COMPATIBLE_ACCESS_KEY_ID
RECORDING_STORAGE_S3_COMPATIBLE_SECRET_ACCESS_KEY
is nowS3_COMPATIBLE_SECRET_ACCESS_KEY
RECORDING_STORAGE_S3_COMPATIBLE_SERVICE_REGION
is nowS3_COMPATIBLE_SERVICE_REGION
RECORDING_STORAGE_S3_COMPATIBLE_SERVICE_URL
is nowS3_COMPATIBLE_SERVICE_URL
The old variables still work, but users are encouraged to switch to the new names.
Run the Agent
The .deb
package installs Agent as a systemd service.
- Restart the service and check its status:
sudo systemctl restart foxglove-agent
systemctl status foxglove-agent
- Enable automatic startup (optional):
sudo systemctl enable foxglove-agent
Monitor the logs with journalctl
for debugging:
journalctl -u foxglove-agent