variable "consul_address" { type = string description = "Full address of Consul instance to get catalog from" default = "http://127.0.0.1:5400" } job "prometheus" { datacenters = ["dc1"] group "prometheus" { count = 1 network { mode = "bridge" port "web" { host_network = "loopback" to = 9090 } } ephemeral_disk { migrate = true sticky = true } service { name = "prometheus" port = "web" connect { sidecar_service { proxy { local_service_port = 9090 } } sidecar_task { resources { cpu = 50 memory = 50 } } } check { type = "http" path = "/" port = "web" interval = "10s" timeout = "10s" } // TODO: Remove traefik tags tags = [ "traefik.enable=true", ] } task "prometheus" { driver = "docker" config { image = "prom/prometheus:v2.30.2" ports = ["web"] args = [ "--config.file=/etc/prometheus/config/prometheus.yml", "--storage.tsdb.path=/prometheus", "--web.listen-address=0.0.0.0:9090", "--web.console.libraries=/usr/share/prometheus/console_libraries", "--web.console.templates=/usr/share/prometheus/consoles", ] mount { type = "bind" target = "/etc/prometheus/config" source = "local/config" } } template { data = <