Skip to content
Snippets Groups Projects
Commit fea5a9f8 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

Merge branch 'fix-cs001-monitoring' into 'master'

Fix cs001 monitoring

See merge request !861
parents 0c8d09dd 59589dd2
No related branches found
No related tags found
1 merge request!861Fix cs001 monitoring
......@@ -35,22 +35,6 @@ job "log-scraping" {
sticky = true
}
service {
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "prometheus"
local_bind_port = 9090
}
upstreams {
destination_name = "loki"
local_bind_port = 3100
}
}
}
}
}
task "vector" {
driver = "docker"
......@@ -129,7 +113,7 @@ healthchecks.require_healthy = true
[sinks.loki]
type = "loki"
inputs = [ "nomad-flags" ]
endpoint = "http://localhost:3100"
endpoint = "http://loki.service.consul:3100"
encoding.codec = "json"
healthcheck.enabled = true
remove_label_fields = true
......@@ -150,7 +134,7 @@ healthchecks.require_healthy = true
[sinks.prometheus_remote_write]
type = "prometheus_remote_write"
inputs = [ "host_metrics", "nomad_metrics", "vector_metrics" ]
endpoint = "http://localhost:9090/api/v1/write"
endpoint = "http://prometheus.service.consul:9090/api/v1/write"
healthcheck.enabled = false
EOF
}
......
......@@ -8,7 +8,7 @@ job "monitoring" {
network {
mode = "bridge"
port "postgres" {
to = 5432
static = 5432
}
}
......@@ -22,11 +22,7 @@ job "monitoring" {
name = "postgres"
port = "postgres"
task = "postgres"
address_mode = "alloc"
connect {
sidecar_service {}
}
}
task "postgres" {
......@@ -69,24 +65,6 @@ job "monitoring" {
name = "grafana"
port = "http"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "postgres"
local_bind_port = 5432
}
upstreams {
destination_name = "prometheus"
local_bind_port = 9090
}
upstreams {
destination_name = "loki"
local_bind_port = 3100
}
}
}
}
}
task "wait-for-db" {
......@@ -99,7 +77,7 @@ job "monitoring" {
config {
image = "[[.registry.astron.url]]/postgres:[[.monitoring.db.version]]"
command = "sh"
args = ["-c", "while ! pg_isready -h localhost; do sleep 1; done"]
args = ["-c", "while ! pg_isready -h postgres.service.consul; do sleep 1; done"]
}
env {
PGPASSFILE = "local/pgpass.txt"
......@@ -107,9 +85,7 @@ job "monitoring" {
template {
data = <<EOH
{{ range service "postgres" }}
localhost:5432:grafana:postgres:password
{{ end }}
postgres.service.consul:5432:grafana:postgres:password
EOH
destination = "local/pgpass.txt"
perms = "600"
......@@ -138,7 +114,7 @@ localhost:5432:grafana:postgres:password
GF_SERVER_ROOT_URL = "%(protocol)s://%(domain)s:%(http_port)s/grafana/"
GF_SERVER_SERVE_FROM_SUB_PATH = "true"
GF_DATABASE_TYPE = "postgres"
GF_DATABASE_HOST = "localhost:5432"
GF_DATABASE_HOST = "postgres.service.consul:5432"
GF_DATABASE_NAME = "grafana"
GF_DATABASE_USER = "postgres"
GF_DATABASE_PASSWORD = "password"
......@@ -157,7 +133,7 @@ localhost:5432:grafana:postgres:password
access: proxy
orgId: 1
uid: prometheus
url: http://localhost:9090
url: http://prometheus.service.consul:9090
isDefault: true
EOH
......@@ -173,7 +149,7 @@ localhost:5432:grafana:postgres:password
access: proxy
orgId: 1
uid: loki
url: http://localhost:3100
url: http://loki.service.consul:3100
jsonData:
esVersion: 7.10.0
includeFrozen: false
......@@ -198,6 +174,7 @@ localhost:5432:grafana:postgres:password
mode = "bridge"
port "prometheus" {
static = 9090
to = 9090
}
}
......@@ -212,18 +189,7 @@ localhost:5432:grafana:postgres:password
tags = ["haproxy", "scrape"]
name = "prometheus"
port = "prometheus"
address_mode = "alloc"
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "snmp-exporter"
local_bind_port = 9116
}
}
}
}
check {
type = "http"
......@@ -327,7 +293,7 @@ localhost:5432:grafana:postgres:password
- source_labels: [__meta_consul_service_address]
target_label: __param_target
- target_label: __address__
replacement: "localhost:9116"
replacement: "snmp-exporter.service.consul:9116"
- source_labels: [__meta_consul_service]
target_label: instance # avoid a dynamic ip:port or hostname
EOH
......@@ -355,7 +321,7 @@ localhost:5432:grafana:postgres:password
port "loki" {
to = 3100
# should be activated when fully replaces docker-compose setup
#static = 3100
static = 3100
}
}
......@@ -371,9 +337,6 @@ localhost:5432:grafana:postgres:password
port = "loki"
address_mode = "alloc"
connect {
sidecar_service {}
}
}
task "loki" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment