job "prometheus" { datacenters = ["aperature"] namespace = "monitoring" group "prometheus" { network { port "http" { to = 9090 } } constraint { attribute = "${attr.unique.hostname}" value = "wheatley" } service { name = "prometheus" port = "http" } task "prometheus" { driver = "docker" config { image = "quay.io/prometheus/prometheus:v2.43.0" args = [ "--config.file=$${NOMAD_TASK_DIR}/prometheus.yml", "--log.level=info", "--storage.tsdb.retention.time=90d", "--storage.tsdb.path=/prometheus", "--web.console.libraries=/usr/share/prometheus/console_libraries", "--web.console.templates=/usr/share/prometheus/consoles" ] } # TODO: Add volumes for persistent storage, configured to be # /prometheus on the container. template { destination = "local/prometheus.yml" data = <