forked from coop-cloud/monitoring-ng
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0eab632ec4 | ||
|
|
e5f57c97f1 |
@@ -10,7 +10,7 @@ export PROMETHEUS_YML_VERSION=v2
|
|||||||
export MATRIX_ALERTMANAGER_CONFIG_VERSION=v1
|
export MATRIX_ALERTMANAGER_CONFIG_VERSION=v1
|
||||||
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=v1
|
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=v1
|
||||||
export GF_ALERTS_NODE_VERSION=v3
|
export GF_ALERTS_NODE_VERSION=v3
|
||||||
export CONFIG_ALLOY_VERSION=v2
|
export CONFIG_ALLOY_VERSION=v3
|
||||||
|
|
||||||
# migrates secrets from old names to new names by reading values from the
|
# migrates secrets from old names to new names by reading values from the
|
||||||
# running containers on the server and re-inserting them under the new names.
|
# running containers on the server and re-inserting them under the new names.
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
||||||
- "coop-cloud.${STACK_NAME}.version=2.0.0+v1.18.1"
|
- "coop-cloud.${STACK_NAME}.version=2.1.0+v1.18.1"
|
||||||
configs:
|
configs:
|
||||||
config_alloy:
|
config_alloy:
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
|||||||
@@ -52,7 +52,32 @@ prometheus.scrape "default" {
|
|||||||
prometheus.exporter.cadvisor.docker.targets,
|
prometheus.exporter.cadvisor.docker.targets,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
forward_to = [prometheus.relabel.container_meta.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
prometheus.relabel "container_meta" {
|
||||||
forward_to = [prometheus.remote_write.prometheus.receiver]
|
forward_to = [prometheus.remote_write.prometheus.receiver]
|
||||||
|
|
||||||
|
// remove sha tail: nginx:1.31.1@sha256:608a... -> nginx:1.31.1
|
||||||
|
rule {
|
||||||
|
source_labels = ["image"]
|
||||||
|
regex = "([^@]+)@sha256:.*"
|
||||||
|
target_label = "image"
|
||||||
|
replacement = "$1"
|
||||||
|
}
|
||||||
|
// split image in name and tag
|
||||||
|
rule {
|
||||||
|
source_labels = ["image"]
|
||||||
|
regex = "(.+):[^:/]+"
|
||||||
|
target_label = "image_name"
|
||||||
|
replacement = "$1"
|
||||||
|
}
|
||||||
|
rule {
|
||||||
|
source_labels = ["image"]
|
||||||
|
regex = ".+:([^:/]+)"
|
||||||
|
target_label = "image_tag"
|
||||||
|
replacement = "$1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prometheus.remote_write "prometheus" {
|
prometheus.remote_write "prometheus" {
|
||||||
@@ -290,7 +315,35 @@ loki.source.docker "docker" {
|
|||||||
loki.source.journal "journal" {
|
loki.source.journal "journal" {
|
||||||
path = "/rootfs/var/log/journal"
|
path = "/rootfs/var/log/journal"
|
||||||
labels = { job = "{{ env "DOMAIN" }}" }
|
labels = { job = "{{ env "DOMAIN" }}" }
|
||||||
|
relabel_rules = loki.relabel.journal.rules
|
||||||
|
forward_to = [loki.process.journal.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.relabel "journal" {
|
||||||
|
forward_to = []
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = ["__journal__systemd_unit"]
|
||||||
|
target_label = "unit"
|
||||||
|
}
|
||||||
|
rule {
|
||||||
|
source_labels = ["__journal_syslog_identifier"]
|
||||||
|
target_label = "ident"
|
||||||
|
}
|
||||||
|
rule {
|
||||||
|
source_labels = ["__journal_priority_keyword"]
|
||||||
|
target_label = "priority"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// drop network db stats (15-20% of kernel logs)
|
||||||
|
loki.process "journal" {
|
||||||
forward_to = [loki.write.loki.receiver]
|
forward_to = [loki.write.loki.receiver]
|
||||||
|
|
||||||
|
stage.drop {
|
||||||
|
expression = ".*NetworkDB stats.*"
|
||||||
|
drop_counter_reason = "networkdb_stats"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
alloy: split image label in "image_name" and "image_tag", relabel journald logs and drop NetworkDB stats
|
||||||
Reference in New Issue
Block a user