diff --git a/monitoring/promtail.nomad b/monitoring/promtail.nomad index ddfe8e2..3b6da23 100644 --- a/monitoring/promtail.nomad +++ b/monitoring/promtail.nomad @@ -1,7 +1,7 @@ variable "promtail_version" { description = "Version of Promtail to deploy" type = string - default = "2.9.1" + default = "2.9.3" } job "promtail" { @@ -112,7 +112,7 @@ job "promtail" { template { data = file("templates/promtail.yml.tpl") destination = "local/promtail.yml" - change_mode = "signal" + change_mode = "restart" change_signal = "SIGHUP" } } diff --git a/monitoring/templates/promtail.yml.tpl b/monitoring/templates/promtail.yml.tpl index ec6ca10..2f35960 100644 --- a/monitoring/templates/promtail.yml.tpl +++ b/monitoring/templates/promtail.yml.tpl @@ -1,14 +1,15 @@ server: log_level: info + http_listen_address: {{ env "NOMAD_IP_http" }} http_listen_port: {{ env "NOMAD_PORT_http" }} grpc_listen_port: {{ env "NOMAD_PORT_grpc" }} positions: filename: /data/positions.yaml - +{{ range service "loki-http-server" }} clients: - - url: http://localhost:9999/loki/loki/api/v1/push - + - url: http://{{ .Address }}:{{ .Port }}/loki/api/v1/push +{{ end }} scrape_configs: - job_name: vault static_configs: @@ -42,7 +43,7 @@ scrape_configs: - localhost labels: job: nomad_allocations - __path__: /opt/nomad/alloc/*/*/alloc/logs + __path__: /opt/nomad/alloc/*/*/alloc/logs/* - job_name: journal journal: json: false