Docker Integration
Connect Docker to Ops Atlas for automatic service discovery.
Auto-Discovery
Ops Atlas can automatically discover and monitor Docker containers.
Enable Docker Socket
yaml
services:
ops-atlas:
volumes:
- /var/run/docker.sock:/var/run/docker.sock:roContainer Labels
Add labels to containers for enhanced discovery:
yaml
services:
my-app:
labels:
ops-atlas.enabled: "true"
ops-atlas.name: "My Application"
ops-atlas.health.endpoint: "/health"
ops-atlas.health.interval: "30s"Manual Registration
Register containers via API:
bash
curl -X POST http://localhost:3000/api/v1/services \
-H "Authorization: Bearer $TOKEN" \
-d '{
"name": "my-app",
"type": "docker",
"container_id": "abc123"
}'Metrics Collection
Collected metrics:
- CPU usage
- Memory usage
- Network I/O
- Disk I/O
- Container status
Events
Ops Atlas listens for Docker events:
- Container start/stop
- Health check status
- Resource limit changes
Security
For production, consider:
yaml
# Read-only socket access
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# Or use Docker API over TCP with TLS
environment:
- DOCKER_HOST=tcp://docker-host:2376
- DOCKER_TLS_VERIFY=1
- DOCKER_CERT_PATH=/certs