docker.recipes

Open Source Datadog Alternative

advanced

Full-featured observability platform with metrics, logs, traces, and dashboards.

Overview

VictoriaMetrics is a fast, cost-effective time-series database designed as a high-performance alternative to Prometheus, offering significantly better data compression and query performance while maintaining full PromQL compatibility. Originally developed by VictoriaMetrics team in 2019, it has become a popular choice for organizations seeking to reduce infrastructure costs while scaling their metrics storage beyond Prometheus limitations. This observability stack combines VictoriaMetrics with Grafana for visualization, Loki for log aggregation, Tempo for distributed tracing, Vector for log collection, and Alertmanager for notifications. This particular combination creates a comprehensive observability platform that rivals commercial solutions like Datadog by providing the three pillars of observability: metrics through VictoriaMetrics, logs through Loki, and traces through Tempo. The stack leverages Vector as a high-performance data pipeline for log collection and transformation, while Grafana serves as the unified interface for querying and visualizing all telemetry data. Alertmanager handles notification routing and alert deduplication across the entire stack, creating a cohesive monitoring experience. This configuration is ideal for engineering teams, DevOps professionals, and organizations looking to implement enterprise-grade observability without the recurring costs of SaaS solutions. Startups burning through observability budgets, enterprises with data sovereignty requirements, and infrastructure teams managing Kubernetes clusters will find this stack particularly valuable. The combination provides the functionality of premium monitoring platforms while maintaining complete control over data retention, storage costs, and customization.

Key Features

  • VictoriaMetrics high-compression storage with 90-day retention configured for long-term metrics analysis
  • VMAgent automatic service discovery and metrics scraping with Prometheus configuration compatibility
  • Loki label-based log indexing that dramatically reduces storage costs compared to full-text search solutions
  • Tempo distributed tracing with OTLP receivers supporting both gRPC (4317) and HTTP (4318) protocols
  • Vector high-performance log collection with Docker socket access for container log aggregation
  • Grafana TraceQL editor integration for advanced trace querying and correlation with metrics
  • Alertmanager notification routing with support for Slack, email, PagerDuty, and webhook integrations
  • Cross-component correlation enabling jump from metrics to logs to traces within Grafana interface

Common Use Cases

  • 1Kubernetes cluster monitoring with pod metrics, container logs, and distributed trace correlation
  • 2Application performance monitoring for microservices architectures requiring trace analysis
  • 3Infrastructure cost optimization by replacing expensive SaaS monitoring solutions
  • 4Regulatory compliance environments requiring on-premises data retention and sovereignty
  • 5Development teams needing full observability stack in local or staging environments
  • 6High-volume metrics storage where Prometheus storage limitations become bottlenecks
  • 7Multi-tenant environments requiring separate data isolation and retention policies

Prerequisites

  • Minimum 4GB RAM recommended (VictoriaMetrics 512MB, Grafana 512MB, Loki 1GB, Tempo 512MB, others 256MB each)
  • Available ports 3000, 3100, 3200, 4317, 4318, 8428, 8429, 8686, 9093 on host system
  • Docker socket access permissions for Vector container log collection functionality
  • Configuration files: loki-config.yml, tempo.yml, vector.toml, alertmanager.yml, and prometheus.yml
  • Understanding of PromQL query language for VictoriaMetrics metrics exploration
  • Familiarity with LogQL for Loki log querying and TraceQL for Tempo trace analysis

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 victoriametrics:
3 image: victoriametrics/victoria-metrics:latest
4 ports:
5 - "8428:8428"
6 volumes:
7 - vm_data:/victoria-metrics-data
8 command:
9 - '--storageDataPath=/victoria-metrics-data'
10 - '--retentionPeriod=90d'
11 - '--httpListenAddr=:8428'
12 networks:
13 - obs-net
14 restart: unless-stopped
15
16 vmagent:
17 image: victoriametrics/vmagent:latest
18 ports:
19 - "8429:8429"
20 volumes:
21 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
22 - vmagent_data:/vmagent-data
23 command:
24 - '--promscrape.config=/etc/prometheus/prometheus.yml'
25 - '--remoteWrite.url=http://victoriametrics:8428/api/v1/write'
26 depends_on:
27 - victoriametrics
28 networks:
29 - obs-net
30 restart: unless-stopped
31
32 loki:
33 image: grafana/loki:latest
34 ports:
35 - "3100:3100"
36 volumes:
37 - ./loki-config.yml:/etc/loki/local-config.yaml:ro
38 - loki_data:/loki
39 command: -config.file=/etc/loki/local-config.yaml
40 networks:
41 - obs-net
42 restart: unless-stopped
43
44 tempo:
45 image: grafana/tempo:latest
46 ports:
47 - "3200:3200"
48 - "4317:4317"
49 - "4318:4318"
50 volumes:
51 - ./tempo.yml:/etc/tempo/tempo.yaml:ro
52 - tempo_data:/tmp/tempo
53 command: -config.file=/etc/tempo/tempo.yaml
54 networks:
55 - obs-net
56 restart: unless-stopped
57
58 vector:
59 image: timberio/vector:latest-alpine
60 ports:
61 - "8686:8686"
62 volumes:
63 - ./vector.toml:/etc/vector/vector.toml:ro
64 - /var/run/docker.sock:/var/run/docker.sock:ro
65 networks:
66 - obs-net
67 restart: unless-stopped
68
69 alertmanager:
70 image: prom/alertmanager:latest
71 ports:
72 - "9093:9093"
73 volumes:
74 - ./alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
75 - alertmanager_data:/alertmanager
76 command:
77 - '--config.file=/etc/alertmanager/alertmanager.yml'
78 - '--storage.path=/alertmanager'
79 networks:
80 - obs-net
81 restart: unless-stopped
82
83 grafana:
84 image: grafana/grafana:latest
85 ports:
86 - "3000:3000"
87 environment:
88 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
89 - GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
90 volumes:
91 - grafana_data:/var/lib/grafana
92 - ./grafana/provisioning:/etc/grafana/provisioning
93 depends_on:
94 - victoriametrics
95 - loki
96 - tempo
97 networks:
98 - obs-net
99 restart: unless-stopped
100
101volumes:
102 vm_data:
103 vmagent_data:
104 loki_data:
105 tempo_data:
106 alertmanager_data:
107 grafana_data:
108
109networks:
110 obs-net:
111 driver: bridge

.env Template

.env
1# Grafana
2GRAFANA_PASSWORD=secure_grafana_password
3
4# VictoriaMetrics
5VM_RETENTION_PERIOD=90d
6
7# Alertmanager Slack webhook (optional)
8SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/xxx/xxx

Usage Notes

  1. 1Grafana at http://localhost:3000
  2. 2VictoriaMetrics at http://localhost:8428
  3. 3Loki at http://localhost:3100
  4. 4Tempo traces at http://localhost:3200
  5. 5Create config files for Loki, Tempo, and Vector

Individual Services(7 services)

Copy individual services to mix and match with your existing compose files.

victoriametrics
victoriametrics:
  image: victoriametrics/victoria-metrics:latest
  ports:
    - "8428:8428"
  volumes:
    - vm_data:/victoria-metrics-data
  command:
    - "--storageDataPath=/victoria-metrics-data"
    - "--retentionPeriod=90d"
    - "--httpListenAddr=:8428"
  networks:
    - obs-net
  restart: unless-stopped
vmagent
vmagent:
  image: victoriametrics/vmagent:latest
  ports:
    - "8429:8429"
  volumes:
    - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
    - vmagent_data:/vmagent-data
  command:
    - "--promscrape.config=/etc/prometheus/prometheus.yml"
    - "--remoteWrite.url=http://victoriametrics:8428/api/v1/write"
  depends_on:
    - victoriametrics
  networks:
    - obs-net
  restart: unless-stopped
loki
loki:
  image: grafana/loki:latest
  ports:
    - "3100:3100"
  volumes:
    - ./loki-config.yml:/etc/loki/local-config.yaml:ro
    - loki_data:/loki
  command: "-config.file=/etc/loki/local-config.yaml"
  networks:
    - obs-net
  restart: unless-stopped
tempo
tempo:
  image: grafana/tempo:latest
  ports:
    - "3200:3200"
    - "4317:4317"
    - "4318:4318"
  volumes:
    - ./tempo.yml:/etc/tempo/tempo.yaml:ro
    - tempo_data:/tmp/tempo
  command: "-config.file=/etc/tempo/tempo.yaml"
  networks:
    - obs-net
  restart: unless-stopped
vector
vector:
  image: timberio/vector:latest-alpine
  ports:
    - "8686:8686"
  volumes:
    - ./vector.toml:/etc/vector/vector.toml:ro
    - /var/run/docker.sock:/var/run/docker.sock:ro
  networks:
    - obs-net
  restart: unless-stopped
alertmanager
alertmanager:
  image: prom/alertmanager:latest
  ports:
    - "9093:9093"
  volumes:
    - ./alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
    - alertmanager_data:/alertmanager
  command:
    - "--config.file=/etc/alertmanager/alertmanager.yml"
    - "--storage.path=/alertmanager"
  networks:
    - obs-net
  restart: unless-stopped
grafana
grafana:
  image: grafana/grafana:latest
  ports:
    - "3000:3000"
  environment:
    - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
    - GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
  volumes:
    - grafana_data:/var/lib/grafana
    - ./grafana/provisioning:/etc/grafana/provisioning
  depends_on:
    - victoriametrics
    - loki
    - tempo
  networks:
    - obs-net
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 victoriametrics:
5 image: victoriametrics/victoria-metrics:latest
6 ports:
7 - "8428:8428"
8 volumes:
9 - vm_data:/victoria-metrics-data
10 command:
11 - '--storageDataPath=/victoria-metrics-data'
12 - '--retentionPeriod=90d'
13 - '--httpListenAddr=:8428'
14 networks:
15 - obs-net
16 restart: unless-stopped
17
18 vmagent:
19 image: victoriametrics/vmagent:latest
20 ports:
21 - "8429:8429"
22 volumes:
23 - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
24 - vmagent_data:/vmagent-data
25 command:
26 - '--promscrape.config=/etc/prometheus/prometheus.yml'
27 - '--remoteWrite.url=http://victoriametrics:8428/api/v1/write'
28 depends_on:
29 - victoriametrics
30 networks:
31 - obs-net
32 restart: unless-stopped
33
34 loki:
35 image: grafana/loki:latest
36 ports:
37 - "3100:3100"
38 volumes:
39 - ./loki-config.yml:/etc/loki/local-config.yaml:ro
40 - loki_data:/loki
41 command: -config.file=/etc/loki/local-config.yaml
42 networks:
43 - obs-net
44 restart: unless-stopped
45
46 tempo:
47 image: grafana/tempo:latest
48 ports:
49 - "3200:3200"
50 - "4317:4317"
51 - "4318:4318"
52 volumes:
53 - ./tempo.yml:/etc/tempo/tempo.yaml:ro
54 - tempo_data:/tmp/tempo
55 command: -config.file=/etc/tempo/tempo.yaml
56 networks:
57 - obs-net
58 restart: unless-stopped
59
60 vector:
61 image: timberio/vector:latest-alpine
62 ports:
63 - "8686:8686"
64 volumes:
65 - ./vector.toml:/etc/vector/vector.toml:ro
66 - /var/run/docker.sock:/var/run/docker.sock:ro
67 networks:
68 - obs-net
69 restart: unless-stopped
70
71 alertmanager:
72 image: prom/alertmanager:latest
73 ports:
74 - "9093:9093"
75 volumes:
76 - ./alertmanager.yml:/etc/alertmanager/alertmanager.yml:ro
77 - alertmanager_data:/alertmanager
78 command:
79 - '--config.file=/etc/alertmanager/alertmanager.yml'
80 - '--storage.path=/alertmanager'
81 networks:
82 - obs-net
83 restart: unless-stopped
84
85 grafana:
86 image: grafana/grafana:latest
87 ports:
88 - "3000:3000"
89 environment:
90 - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
91 - GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
92 volumes:
93 - grafana_data:/var/lib/grafana
94 - ./grafana/provisioning:/etc/grafana/provisioning
95 depends_on:
96 - victoriametrics
97 - loki
98 - tempo
99 networks:
100 - obs-net
101 restart: unless-stopped
102
103volumes:
104 vm_data:
105 vmagent_data:
106 loki_data:
107 tempo_data:
108 alertmanager_data:
109 grafana_data:
110
111networks:
112 obs-net:
113 driver: bridge
114EOF
115
116# 2. Create the .env file
117cat > .env << 'EOF'
118# Grafana
119GRAFANA_PASSWORD=secure_grafana_password
120
121# VictoriaMetrics
122VM_RETENTION_PERIOD=90d
123
124# Alertmanager Slack webhook (optional)
125SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/xxx/xxx
126EOF
127
128# 3. Start the services
129docker compose up -d
130
131# 4. View logs
132docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/datadog-alternative/run | bash

Troubleshooting

  • VictoriaMetrics 'no space left on device' error: Increase Docker volume size or adjust --retentionPeriod to reduce storage usage
  • Loki 'entry out of order' ingestion failures: Configure Vector or log shippers with proper timestamp sorting and batch settings
  • Tempo traces not appearing in Grafana: Verify OTLP endpoint connectivity and check tempo.yml receiver configuration matches application instrumentation
  • Vector container logs not collected: Ensure Docker socket mount permissions and check vector.toml Docker source configuration
  • Grafana data source connection timeouts: Verify inter-service network connectivity and check service health endpoints before configuring data sources
  • Alertmanager notifications not sending: Validate alertmanager.yml routing configuration and test webhook/SMTP connectivity from container network

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space