job "prometheus" { datacenters = ["dc1"] group "prometheus" { count = 1 network { mode = "bridge" port "web" { host_network = "wesher" to = 9090 } port "pushgateway" { host_network = "wesher" static = 9091 } } ephemeral_disk { migrate = true sticky = true } service { name = "prometheus" provider = "nomad" port = "web" // TODO: Remove traefik tags tags = [ "traefik.enable=true", "traefik.http.routers.prometheus.entryPoints=websecure", ] } service { name = "pushgateway" provider = "nomad" port = "pushgateway" } task "prometheus" { driver = "docker" config { image = "prom/prometheus:v2.43.0" ports = ["web"] args = [ "--config.file=${NOMAD_TASK_DIR}/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", ] } template { data = <