/
prometheus.hcl
72 lines (63 loc) · 1.36 KB
/
prometheus.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
job "prometheus" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "app" {
count = 1
restart {
attempts = 3
delay = "20s"
mode = "delay"
}
task "prometheus" {
driver = "docker"
config {
image = "prom/prometheus:v2.8.1"
force_pull = true
port_map = {
http = 9090
}
volumes = [
"/opt/prometheus/:/etc/prometheus/"
]
args = [
"--config.file=/etc/prometheus/prometheus.yml",
"--storage.tsdb.path=/prometheus",
"--web.console.libraries=/usr/share/prometheus/console_libraries",
"--web.console.templates=/usr/share/prometheus/consoles",
"--web.enable-admin-api"
]
logging {
type = "journald"
config {
tag = "PROMETHEUS"
}
}
}
service {
name = "prometheus"
address_mode = "driver"
tags = [
"metrics"
]
port = "http"
check {
type = "http"
path = "/targets"
interval = "10s"
timeout = "2s"
address_mode = "driver"
}
}
resources {
cpu = 50
memory = 100
network {
port "http" {
static = "9090"
}
}
}
}
}
}