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", "traefik.http.routers.prometheus.entryPoints=websecure", ] } task "prometheus" { driver = "docker" config { image = "prom/prometheus:v2.30.2" ports = ["web"] args = [ "--config.file=/etc/prometheus/config/prometheus.yml", "--storage.tsdb.path=${NOMAD_ALLOC_DIR}/data/tsdb", "--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 = <