Grafana LGTM Observability Stack
Self-managed Grafana, Loki, Tempo, and Mimir (AGPLv3) microservices stack for horizontally scalable Prometheus metrics, logs, and distributed traces backed by object storage.
Medium — 2 to 15 TB compressed data across two replicated shards
Monthly cost
$2,245.76
Annual cost
$26,949/year
| Compute | $1,568.26 |
| Storage | $677.50 |
| Other | $0.00 |
Saves $202.31/mo (9%) across m8g.4xlarge, c7g.xlarge.
| Role | Instance | vCPU | GB RAM | Storage |
|---|---|---|---|---|
| Clickhouse Server | 2 × m7i.4xlarge | 16 | 64 | 4 TB ssd |
| Clickhouse Keeper | 3 × c7i.xlarge | 4 | 8 | 100 GB nvme |
This medium architecture handles two to fifteen terabytes of compressed data across two replicated shards without high availability enabled. Compute is the primary cost driver at one thousand five hundred sixty-eight dollars and twenty-six cents per month. The setup utilizes two instances of m7i.4xlarge for the database and three c7i.xlarge instances for quorum management. Running without high availability reduces redundancy and risks downtime during hardware failures or maintenance events in us-east-1.
Share the current URL or copy the AWS Terraform / OpenTofu baseline.
# Compatible with Terraform >= 1.6 and OpenTofu >= 1.6
terraform {
required_version = ">= 1.6.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
data "aws_availability_zones" "available" {
state = "available"
}
data "aws_ami" "debian_12_x86" {
most_recent = true
owners = ["136693071363"]
filter {
name = "name"
values = ["debian-12-amd64-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
}
locals {
azs = slice(data.aws_availability_zones.available.names, 0, 3)
}
resource "aws_vpc" "workload" {
cidr_block = "10.42.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "clickhouse-vpc"
}
}
resource "aws_subnet" "workload" {
count = 3
vpc_id = aws_vpc.workload.id
cidr_block = cidrsubnet(aws_vpc.workload.cidr_block, 8, count.index)
availability_zone = local.azs[count.index]
tags = {
Name = "clickhouse-subnet-${count.index + 1}"
}
}
# Generated for AWS (us-east-1) from the current estimate state.
resource "aws_instance" "clickhouse_server_1" {
count = 2
ami = data.aws_ami.debian_12_x86.id
instance_type = "m7i.4xlarge"
subnet_id = aws_subnet.workload[count.index % length(aws_subnet.workload)].id
associate_public_ip_address = false
root_block_device {
volume_type = "gp3"
volume_size = 50
encrypted = true
}
tags = {
Name = "clickhouse-clickhouse-server-1-${count.index + 1}"
App = "clickhouse"
Role = "clickhouse-server"
}
}
resource "aws_ebs_volume" "clickhouse_server_1_data" {
count = 2
availability_zone = local.azs[count.index % length(local.azs)]
size = 4000
type = "gp3"
encrypted = true
tags = {
Name = "clickhouse-clickhouse-server-1-data-${count.index + 1}"
App = "clickhouse"
Role = "clickhouse-server"
}
}
resource "aws_volume_attachment" "clickhouse_server_1_attach" {
count = 2
device_name = "/dev/sdf"
volume_id = aws_ebs_volume.clickhouse_server_1_data[count.index].id
instance_id = aws_instance.clickhouse_server_1[count.index].id
}
resource "aws_instance" "clickhouse_keeper_2" {
count = 3
ami = data.aws_ami.debian_12_x86.id
instance_type = "c7i.xlarge"
subnet_id = aws_subnet.workload[count.index % length(aws_subnet.workload)].id
associate_public_ip_address = false
root_block_device {
volume_type = "gp3"
volume_size = 50
encrypted = true
}
tags = {
Name = "clickhouse-clickhouse-keeper-2-${count.index + 1}"
App = "clickhouse"
Role = "clickhouse-keeper"
}
}
resource "aws_ebs_volume" "clickhouse_keeper_2_data" {
count = 3
availability_zone = local.azs[count.index % length(local.azs)]
size = 100
type = "gp3"
encrypted = true
tags = {
Name = "clickhouse-clickhouse-keeper-2-data-${count.index + 1}"
App = "clickhouse"
Role = "clickhouse-keeper"
}
}
resource "aws_volume_attachment" "clickhouse_keeper_2_attach" {
count = 3
device_name = "/dev/sdf"
volume_id = aws_ebs_volume.clickhouse_keeper_2_data[count.index].id
instance_id = aws_instance.clickhouse_keeper_2[count.index].id
}
Reference architecture: ClickHouse Self-Managed for two-shard-replicated, version ClickHouse production sizing & ClickHouse Keeper quorum guidance, retrieved November 11, 2026.
https://clickhouse.com/docs/en/operations/tips
Pricing: AWS pricing snapshot, retrieved November 22, 2026.
Commercial pricing only. GovCloud, sovereign cloud, and discounts beyond those shown are not modelled.
Based on ClickHouse self-managed operational sizing tips (1:4 CPU-to-RAM ratio and dedicated Keeper quorums).
Estimate excludes OpenTelemetry collector fleets, Kafka/Vector ingestion pipelines, backup buckets, and cross-AZ replication egress.
Self-managed Grafana, Loki, Tempo, and Mimir (AGPLv3) microservices stack for horizontally scalable Prometheus metrics, logs, and distributed traces backed by object storage.
Self-managed VictoriaMetrics for long-retention metrics storage, Prometheus remote write, and cost-conscious observability backends.
Self-managed Confluent Platform 8.x (Apache Kafka 4.x KRaft) for durable event streaming, schema governance, and Connect pipelines.