Docker Agent Installation

Install CostGraph agent using Docker or Docker Compose for easy deployment and management.

Prerequisites

  • Docker: Ensure Docker is installed and running on your system.
  • API Key: Obtain an API key from the CostGraph dashboard.
  • Docker Compose (Optional): Install Docker Compose for multi-container deployments.

Installation Methods

Docker Run Installation

Basic Docker Run Command

Assuming you have your configuration at /etc/costgraph-agent/conf.yaml
docker run -d --name costgraph-agent \
  --restart=always \
  --pid=host \
  --net=host \
  -v /proc:/host/proc:ro \
  -v $(pwd)/etc/costgraph-agent:/etc/costgraph-agent:ro \
  -v $(pwd)/var/lib/costgraph-agent:/var/lib/costgraph-agent \
  --workdir /var/lib/costgraph-agent \
  ghcr.io/baselinehq/costgraph-agent:latest \
  costgraph-agent -conf /etc/costgraph-agent/conf.yaml

Configuration

api_key: "your-api-key-here"
prometheus:
  enabled: true
  url: "https://your-prometheus-endpoint"
  write_path: "/api/v1/write"
  timeout: 10s
  interval: 60s
  tlsInsecure: false
  labels:
    env: "production"
expected_utilisation:
  cpu: 60
  memory: 75

Verification

1

Check Container Status

Verify the container is running:
docker ps | grep costgraph-agent
2

Check Metrics

Verify metrics are being collected:
curl http://localhost:9090/metrics
3

Check Logs

View container logs:
docker logs costgraph-agent