job "exporters" { datacenters = ["dc1"] type = "system" group "promtail" { network { mode = "bridge" port "promtail" { %{~ if use_wesher ~} host_network = "wesher" %{~ endif ~} 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.9.1" args = ["-config.file=$${NOMAD_TASK_DIR}/promtail.yml"] ports = ["promtail"] # 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 = <