Created
March 11, 2019 16:17
-
-
Save asrivascrealytee/00856a03518e665754ed87b8224cc8ea to your computer and use it in GitHub Desktop.
Grafana+loki+promtail nomad example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "grafana" { | |
datacenters = ["dc1"] | |
type = "service" | |
group "grafana" { | |
count = 1 | |
restart { | |
attempts = 10 | |
interval = "5m" | |
delay = "25s" | |
mode = "delay" | |
} | |
task "grafana" { | |
driver = "docker" | |
config { | |
image = "grafana/grafana" | |
port_map { | |
grafana_port = 3000 | |
} | |
} | |
resources { | |
cpu = 50 | |
memory = 32 | |
network { | |
mbits = 1 | |
port "grafana_port"{} | |
} | |
} | |
service { | |
name = "graphana" | |
port = "grafana_port" | |
check { | |
type = "http" | |
path = "/health" | |
interval = "10s" | |
timeout = "2s" | |
} | |
} | |
} | |
} | |
} |
Author
asrivascrealytee
commented
Mar 11, 2019
job "promtail" {
datacenters = ["dc1"]
type = "service"
group "promtail" {
count = 1
restart {
attempts = 10
interval = "5m"
delay = "25s"
mode = "delay"
}
task "promtail" {
driver = "docker"
config {
image = "grafana/promtail:master"
args = [
"-config.file",
"local/config.yaml",
]
port_map {
promtail_port = 3000
}
}
template {
data = <<EOH
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
client:
url: http://10.70.103.139:22503/api/prom/push
scrape_configs:
- job_name: system
entry_parser: raw
static_configs:
- targets:
- localhost
labels:
job: varlogs
__path__: /alloc/logs/*
EOH
destination = "local/config.yaml"
}
resources {
cpu = 50
memory = 32
network {
mbits = 1
port "promtail_port"{}
}
}
service {
name = "promtail"
port = "promtail_port"
check {
type = "http"
path = "/health"
interval = "10s"
timeout = "2s"
}
}
}
}
}
Hey, I was trying to install Grafana-Loki. So, I have a question regarding promtail job. path: /alloc/logs/* this one only gives about logs promtail job. In my nomad, I have other jobs and I would like to push their logs, in that case, which path should I use? Or is there any better way to push other job logs?
Check this out: https://github.com/cyriltovena/observability-nomad
Thanks! :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment