job "metrics" { datacenters = ["dc1"] type = "system" group "promtail" { network { mode = "bridge" port "promtail" { to = 9080 } } service { name = "promtail" provider = "nomad" port = "promtail" meta { nomad_dc = "${NOMAD_DC}" nomad_node_name = "${node.unique.name}" } tags = [ "prometheus.scrape", ] } task "promtail" { driver = "docker" meta = { "diun.sort_tags" = "semver" "diun.watch_repo" = true "diun.include_tags" = "^[0-9]+\\.[0-9]+\\.[0-9]+$" } config { image = "grafana/promtail:2.7.1" args = ["-config.file=/etc/promtail/promtail.yml"] ports = ["promtail"] # Mount config mount { type = "bind" target = "/etc/promtail/promtail.yml" source = "local/promtail.yml" } # Bind mount host machine-id and log directories mount { type = "bind" source = "/etc/machine-id" target = "/etc/machine-id" readonly = true } mount { type = "bind" source = "/var/log/journal/" target = "/var/log/journal/" readonly = true } mount { type = "bind" source = "/run/log/journal/" target = "/run/log/journal/" readonly = true } # mount { # type = "bind" # source = "/var/log/audit" # target = "/var/log/audit" # readonly = true # } } template { data = <