aboutsummaryrefslogtreecommitdiff
path: root/app/telemetry/deploy
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-26 20:31:57 +0100
committerAlex Auvolat <alex@adnab.me>2022-02-26 20:31:57 +0100
commit7dcb4072dcced7a4d92ae2c356722ccb6bfd5e2b (patch)
tree65c4b542097d1e1bea1ad6c9908c2c0f97b52fc6 /app/telemetry/deploy
parentbd2abf344915f502693a17a5f141518e1609910d (diff)
downloadnixcfg-7dcb4072dcced7a4d92ae2c356722ccb6bfd5e2b.tar.gz
nixcfg-7dcb4072dcced7a4d92ae2c356722ccb6bfd5e2b.zip
Scrape meterics from system process on each node
Diffstat (limited to 'app/telemetry/deploy')
-rw-r--r--app/telemetry/deploy/telemetry-system.hcl59
-rw-r--r--app/telemetry/deploy/telemetry.hcl93
2 files changed, 93 insertions, 59 deletions
diff --git a/app/telemetry/deploy/telemetry-system.hcl b/app/telemetry/deploy/telemetry-system.hcl
index 9dd379d..af9acff 100644
--- a/app/telemetry/deploy/telemetry-system.hcl
+++ b/app/telemetry/deploy/telemetry-system.hcl
@@ -57,5 +57,64 @@ EOH
}
}
}
+
+ group "collector" {
+ network {
+ port "otel_grpc" {
+ static = 4317
+ }
+ port "apm" {
+ static = 8200
+ }
+ }
+
+ task "otel" {
+ driver = "docker"
+ config {
+ image = "otel/opentelemetry-collector-contrib:0.44.0"
+ args = [
+ "--config=/etc/otel-config.yaml",
+ ]
+ network_mode = "host"
+ ports= [ "otel_grpc" ]
+ volumes = [
+ "secrets/otel-config.yaml:/etc/otel-config.yaml"
+ ]
+ }
+
+ template {
+ data = file("../config/otel-config.yaml")
+ destination = "secrets/otel-config.yaml"
+ }
+
+ resources {
+ memory = 200
+ cpu = 100
+ }
+ }
+
+ task "apm" {
+ driver = "docker"
+ config {
+ image = "docker.elastic.co/apm/apm-server:7.17.0"
+ network_mode = "host"
+ ports = [ "apm" ]
+ args = [ "--strict.perms=false" ]
+ volumes = [
+ "secrets/apm-config.yaml:/usr/share/apm-server/apm-server.yml:ro"
+ ]
+ }
+
+ template {
+ data = file("../config/apm-config.yaml")
+ destination = "secrets/apm-config.yaml"
+ }
+
+ resources {
+ memory = 200
+ cpu = 100
+ }
+ }
+ }
}
diff --git a/app/telemetry/deploy/telemetry.hcl b/app/telemetry/deploy/telemetry.hcl
index 90cde54..c3edd4c 100644
--- a/app/telemetry/deploy/telemetry.hcl
+++ b/app/telemetry/deploy/telemetry.hcl
@@ -1,54 +1,14 @@
job "telemetry" {
datacenters = ["neptune"]
type = "service"
-
- group "grafana" {
- count = 1
- constraint {
- attribute = "${attr.unique.hostname}"
- operator = "="
- value = "carcajou"
- }
+ group "kibana" {
+ count = 1
network {
- port "otel_grpc" {
- static = 4317
- }
port "kibana" {
static = 5601
}
- port "apm" {
- static = 8200
- }
- port "grafana" {
- static = 3333
- }
- }
-
- task "otel" {
- driver = "docker"
- config {
- image = "otel/opentelemetry-collector-contrib:0.44.0"
- args = [
- "--config=/etc/otel-config.yaml",
- ]
- network_mode = "host"
- ports= [ "otel_grpc" ]
- volumes = [
- "secrets/otel-config.yaml:/etc/otel-config.yaml"
- ]
- }
-
- template {
- data = file("../config/otel-config.yaml")
- destination = "secrets/otel-config.yaml"
- }
-
- resources {
- memory = 200
- cpu = 100
- }
}
task "kibana" {
@@ -74,28 +34,43 @@ EOH
memory = 1500
cpu = 500
}
- }
- task "apm" {
- driver = "docker"
- config {
- image = "docker.elastic.co/apm/apm-server:7.17.0"
- network_mode = "host"
- ports = [ "apm" ]
- args = [ "--strict.perms=false" ]
- volumes = [
- "secrets/apm-config.yaml:/usr/share/apm-server/apm-server.yml:ro"
+ service {
+ tags = [
+ "kibana",
+ "tricot kibana.home.adnab.me",
]
+ port = 5601
+ address_mode = "driver"
+ name = "kibana"
+ check {
+ type = "tcp"
+ port = 5601
+ address_mode = "driver"
+ interval = "60s"
+ timeout = "5s"
+ check_restart {
+ limit = 3
+ grace = "90s"
+ ignore_warnings = false
+ }
+ }
}
+ }
+ }
+
+ group "grafana" {
+ count = 1
- template {
- data = file("../config/apm-config.yaml")
- destination = "secrets/apm-config.yaml"
- }
+ constraint {
+ attribute = "${attr.unique.hostname}"
+ operator = "="
+ value = "carcajou"
+ }
- resources {
- memory = 200
- cpu = 100
+ network {
+ port "grafana" {
+ static = 3333
}
}