Skip to content

Commit

Permalink
fix(promtail): use consul catalogue to lookup loki server
Browse files Browse the repository at this point in the history
chore: update promtail version
Signed-off-by: Bruce Becker <[email protected]>
  • Loading branch information
brucellino committed May 18, 2024
1 parent c839e2b commit 4c5b8d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions monitoring/promtail.nomad
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down Expand Up @@ -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"
}
}
Expand Down
9 changes: 5 additions & 4 deletions monitoring/templates/promtail.yml.tpl
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4c5b8d9

Please sign in to comment.