CostGraph Agent
CostGraph offers a lightweight agent that runs on your VM and collects VM Process Level observability agent, collects system metrics, computes process-level resource recommendations (CPU, memory), and exports results in Prometheus-compatible formats.Prerequisites
- Linux System: Ensure you have a Linux system with systemd support.
- API Key: Obtain an API key from the CostGraph dashboard.
- Access: Ensure you have root or sudo access to install the service.
- Prometheus: Ensure you have a Prometheus server running.
Installation Steps
1
Download Agent
Download the CostGraph agent binary for your system architecture:
2
Install Binary
Install the binary to the system path:
3
Create Configuration Directory
Create the configuration directory:
4
Create Configuration File
Create the configuration file with your settings:
quick prometheus setup
quick prometheus setup
5
Create Systemd Service
Create the systemd service file:This will run the agent as the current user(modify as needed).
6
Enable and Start Service
Enable and start the CostGraph agent service:
Configuration
Configuration File
The agent configuration is stored in/etc/costgraph-agent/conf.yaml
:
Configuration Options
Option | Description | Default |
---|---|---|
api_key | Your CostGraph API key | Required |
prometheus.enabled | Enable Prometheus metrics export | true |
prometheus.url | Prometheus server endpoint | Required |
prometheus.write_path | Prometheus write API path | "/api/v1/write" |
prometheus.timeout | Request timeout | 10s |
prometheus.interval | Metrics collection interval | 60s |
prometheus.tlsInsecure | Skip TLS verification | false |
prometheus.labels | Additional labels for metrics | {} |
expected_utilisation.cpu | Expected CPU utilization % | 60 |
expected_utilisation.memory | Expected memory utilization % | 75 |
Verification
1
Check Service Status
Verify the service is running:
2
Check Logs
View service logs: