Installation and Usage
DBX for Cloud, DBXC consists of two main components.
- dbxc-agent: A background service (agent) that monitors cloud metrics
- dbxc-ctl: A CLI tool to control the agent (start, stop, check status, view logs)
Agent Installation
| OS | Architecture | Package |
|---|---|---|
| Linux | amd64, arm64 | .tar.gz |
| Windows 10, Windows Server 2016 or later | amd64 | .zip |
- Linux
- Windows
The installation script detects the architecture (x86_64, aarch64) and installs the agent in the dbxc directory under the current path.
curl -fsSL https://repo.whatap.io/agent/dbx/cloud/install.sh | bash
cd dbxc
After the installation, create config.yaml in the dbxc directory and run ./dbxc-ctl start.
Run the following commands in PowerShell. The example uses C:\whatap\dbxc as the installation path.
# Download the latest package
Invoke-WebRequest -Uri "https://repo.whatap.io/agent/dbx/cloud/dbxc.latest.windows-amd64.zip" -OutFile "$env:TEMP\dbxc.zip"
# Extract the package and copy it to the installation path
Expand-Archive -Path "$env:TEMP\dbxc.zip" -DestinationPath "$env:TEMP\dbxc" -Force
New-Item -ItemType Directory -Force -Path "C:\whatap\dbxc" | Out-Null
Copy-Item "$env:TEMP\dbxc\*\*.exe" "C:\whatap\dbxc\" -Force
cd C:\whatap\dbxc
.\dbxc-ctl.exe version
The installation is complete once dbxc-agent.exe and dbxc-ctl.exe are in the installation path. On a server without internet access, download the zip file on another PC, move it to the server, and copy both files to the installation path. Create config.yaml in the installation path and run the agent.
.\dbxc-ctl.exe start -c config.yaml
.\dbxc-ctl.exe status
-
Use version 0.5.13 or later. In earlier versions,
dbxc-ctl startfails on Windows. -
When you create config.yaml with Notepad, change the file type to All Files before saving. Saving it as is produces config.yaml.txt.
-
On a server that is not an AWS EC2 instance, set the AWS credentials in
%USERPROFILE%\.aws\credentialsof the account that runs the agent. -
The agent is not registered as a Windows service, so you must run
dbxc-ctl startagain after the server reboots. -
In the command examples that follow, replace
dbxc-ctlwith.\dbxc-ctl.exeon Windows.
Configuration File Structure
DBXC defines runtime configurations through a YAML configuration file.
Supported Formats
DBXC supports both single-project and multi-project agents.
- YAML format (.yaml, .yml)
- Single file: Run a single agent
- Directory: Run multiple agents
Automatic Search Order for Configuration Files
- File or directory specified with the
coption config.yaml,config.yml(default files)- All
.yaml,.ymlfiles in the current directory
Example Configuration Files
❯ tree
.
├── configs
│ ├── project-1.yml
│ └── project-2.yml
├── dbxc-agent
├── dbxc-ctl
├── dbxc.log
├── dbxc.pid
❯ ls -al
total 68456
drwxr-xr-x 8 kyw staff 256 7 18 20:23 .
drwxr-xr-x 9 kyw staff 288 7 18 20:10 ..
drwxr-xr-x 4 kyw staff 128 7 18 20:23 configs
-rwxr-xr-x 1 kyw staff 20174450 7 18 20:09 dbxc-agent
-rwxr-xr-x 1 kyw staff 8565570 7 18 20:09 dbxc-ctl
-rw------- 1 kyw staff 5574908 7 18 20:30 dbxc.log
-rw-r--r-- 1 kyw staff 5 7 18 20:23 dbxc.pid
input:
csp: "aws" # Enter the cloud service provider.
namespace: "rds"
region: "us-east-1"
instances: # Always collect the specified instances. If you specify an instance inside a cluster here, it will always be collected regardless of autoscale.
- name: "mysql-rds"
slow_query: true # Set this to true if you want to use the slow query page.
clusters:
autoscale:
enabled: false # When autoscale is enabled, scaled instances are added to or removed from the collection targets.
interval: 60 # Autoscale check interval for the specified clusters (unit: seconds).
names:
- "database-cluster-name"
metrics: # Enter the metrics to collect.
- "CPUUtilization"
- "FreeStorageSpace"
- "FreeableMemory"
- "ReadLatency"
- "WriteLatency"
- "ReadIOPS"
- "WriteIOPS"
- "NetworkReceiveThroughput"
- "NetworkTransmitThroughput"
- "FreeLocalStorage"
logs:
enabled: false # Can be enabled/disabled. Select true/false.
groups: # Add the desired AWS log groups.
- "/aws/rds/cluster/database-cluster-name/error"
- "/aws/lambda/MyLambda"
output: # Enter the WhaTap information to receive the collected metric data.
license: "abcdefg-higjgkgjk-zxcvnbnbmc"
host: "127.0.0.1"
Agent Execution and Control Commands
The CLI provides various commands for starting the agent, checking its status, and viewing logs.
Start/Stop
# Start agent
dbxc-ctl start -c project.yaml # Specific config file
dbxc-ctl start --config configs # Multiple projects (directory)
dbxc-ctl start # Automatically search for default config file
# Stop agent
dbxc-ctl stop
# Restart agent
dbxc-ctl restart -c project.yaml
Check Status
# Quick status check
dbxc-ctl status
dbxc-ctl describe
View Logs
# View logs in real time
dbxc-ctl logs -f
# View logs for a specific project only
dbxc-ctl logs -c project.yaml
# Filter logs by level
dbxc-ctl logs --level error
# View the last 100 logs
dbxc-ctl logs --tail 100
If Agent Startup Fails
# Check logs
dbxc-ctl logs --level error
Check Agent Status
# Check all statuses
dbxc-ctl describe
# Check logs for a specific agent
dbxc-ctl logs -c specific-config.yaml -f
Common Troubleshooting
- Port conflict: Check if the default port 53200 is in use
- Configuration file errors: Verify YAML syntax
- Permission issues: Check file read permissions
- PID file lock: Force stop and delete the PID file
Technical Details
Detailed command structure and internal system behavior of DBXC.
Command Structure
dbxc-ctl supports the following commands:
- start: Start DBXC agent
- stop: Stop DBXC agent
- restart: Restart DBXC agent
- logs: View logs
- status or describe: Check agent status
- version: Check version information
- help: Display help
HTTP API Endpoints
The agent provides HTTP endpoints:
http://localhost:53200/health: Health checkhttp://localhost:53200/status: Status informationhttp://localhost:53200/logs: Log viewing
Logging System
- File name: dbxc.log
- Maximum size: 10MB per file
- Maximum number of backup files: 7 (dbxc.log.1, dbxc.log.2, ... dbxc.log.7)
- Retention period: 14 days
- Compression: Automatic compression enabled (.gz for old logs)
- Timezone: Local time
When the log file reaches 10MB, it rotates automatically. Up to 7 backup files are retained, and logs older than 14 days are deleted. Old logs are compressed to save disk space.