Compare commits
42 Commits
cleanup-do
...
forgejo
| Author | SHA1 | Date | |
|---|---|---|---|
|
bf8af312eb
|
|||
|
a2f1636ed4
|
|||
|
f2711fa16e
|
|||
|
2870b9486c
|
|||
|
3a1fabe4f9
|
|||
|
a358837922
|
|||
|
dd0a0c1bb0
|
|||
|
31cabc36ae
|
|||
|
d25986d5cb
|
|||
|
f8f8004445
|
|||
|
aa05d022da
|
|||
|
fb52a76247
|
|||
|
2e2a52eae0
|
|||
|
48419d5afa
|
|||
|
a0a6e2c509
|
|||
|
024f2a8aec
|
|||
|
38095e23fa
|
|||
|
641161329e
|
|||
|
cdacfd035e
|
|||
|
b2d3901f61
|
|||
|
8becf1c1d6
|
|||
|
777b1355dd
|
|||
|
e83433cebd
|
|||
|
a713f98ffb
|
|||
|
8dc84c591c
|
|||
|
d9aa05a4b5
|
|||
|
349df12204
|
|||
|
6c33089078
|
|||
|
4bedebfab1
|
|||
| dd320e9f1c | |||
| 9cb997b25a | |||
| 48d137d194 | |||
| 1acb5ebd6a | |||
| 682f30cef1 | |||
| 694c8a9875 | |||
| 9dfa9cad2a | |||
| 99f8790ec4 | |||
| 310c28e735 | |||
| 16bd65f417 | |||
| 97ebcf306a | |||
| f93370b9ca | |||
| 83461e2e76 |
45
.env.sample
45
.env.sample
@ -1,19 +1,24 @@
|
|||||||
TYPE=monitoring-ng
|
TYPE=monitoring-ng
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
COMPOSE_FILE=compose.yml
|
COMPOSE_FILE=compose.yml
|
||||||
DOMAIN=monitoring.example.com
|
DOMAIN=monitoring-ng.example.com
|
||||||
TIMEOUT=120
|
#TIMEOUT=120
|
||||||
ENABLE_BACKUPS=true
|
ENABLE_BACKUPS=true
|
||||||
|
|
||||||
## Enable this secret for Promtail / Prometheus
|
SECRET_BASIC_AUTH_VERSION=v1
|
||||||
# SECRET_BASIC_AUTH_VERSION=v1
|
# Enable this to send logs to a Loki server, adapt DOMAIN if server is
|
||||||
#
|
# remote
|
||||||
# Promtail (Gathering Logs)
|
# LOKI_PUSH_URL=https://loki.$DOMAIN/loki/api/v1/push
|
||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.promtail.yml"
|
# Enable this on SystemD hosts to read logs
|
||||||
# LOKI_PUSH_URL=https://loki.monitoring.example.org/loki/api/v1/push
|
# JOURNALD=1
|
||||||
|
# Enable this on syslogd hosts and configure the syslogd to send logs to
|
||||||
|
# Alloy on port 514/tcp
|
||||||
|
# SYSLOG=1
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.syslog.yml"
|
||||||
|
|
||||||
## Expose node and cadvisor ports instead of traefik
|
# Enable this to send metrics to a Prometheus server, adapt DOMAIN if
|
||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.expose-ports.yml"
|
# server is remote
|
||||||
|
# PROMETHEUS_REMOTE_WRITE_URL=https://prometheus.$DOMAIN/api/v1/write
|
||||||
|
|
||||||
# Monitoring Server
|
# Monitoring Server
|
||||||
#
|
#
|
||||||
@ -39,19 +44,18 @@ ENABLE_BACKUPS=true
|
|||||||
# LOKI_AWS_REGION=eu-west-1
|
# LOKI_AWS_REGION=eu-west-1
|
||||||
# LOKI_ACCESS_KEY_ID=bush-debrief-approval-robust-scraggly-molecule
|
# LOKI_ACCESS_KEY_ID=bush-debrief-approval-robust-scraggly-molecule
|
||||||
# LOKI_BUCKET_NAMES=loki
|
# LOKI_BUCKET_NAMES=loki
|
||||||
# SECRET_LOKI_AWS_SECRET_ACCESS_KEY_VERSION=v1
|
# SECRET_LOKI_AWS_KEY_VERSION=v1
|
||||||
#
|
#
|
||||||
## Grafana
|
## Grafana
|
||||||
#
|
#
|
||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.grafana.yml"
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.grafana.yml"
|
||||||
# GF_SERVER_ROOT_URL=https://monitoring.example.com
|
# GF_SERVER_ROOT_URL=https://monitoring.example.com
|
||||||
# SECRET_GRAFANA_ADMIN_PASSWORD_VERSION=v1
|
# SECRET_GF_ADMINPASSWD_VERSION=v1
|
||||||
## Seperate domain for Grafana
|
|
||||||
#GRAFANA_DOMAIN=grafana.example.com
|
|
||||||
#
|
#
|
||||||
## Single-Sign-On with OIDC
|
## Single-Sign-On with OIDC
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-oidc.yml"
|
||||||
# OIDC_ENABLED=1
|
# OIDC_ENABLED=1
|
||||||
# SECRET_GRAFANA_OIDC_CLIENT_SECRET_VERSION=v1
|
# SECRET_GF_OIDC_SECRET_VERSION=v1
|
||||||
# OIDC_CLIENT_ID=grafana
|
# OIDC_CLIENT_ID=grafana
|
||||||
# OIDC_AUTH_URL="https://authentik.example.com/application/o/authorize/"
|
# OIDC_AUTH_URL="https://authentik.example.com/application/o/authorize/"
|
||||||
# OIDC_API_URL="https://authentik.example.com/application/o/userinfo/"
|
# OIDC_API_URL="https://authentik.example.com/application/o/userinfo/"
|
||||||
@ -62,17 +66,18 @@ ENABLE_BACKUPS=true
|
|||||||
# GF_INSTALL_PLUGINS=grafana-piechart-panel
|
# GF_INSTALL_PLUGINS=grafana-piechart-panel
|
||||||
#
|
#
|
||||||
## grafana SMTP configuration (optional)
|
## grafana SMTP configuration (optional)
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-smtp.yml"
|
||||||
# GF_SMTP_HOST=changeme
|
# GF_SMTP_HOST=changeme
|
||||||
# GF_SMTP_USER=changme
|
# GF_SMTP_USER=changme
|
||||||
# GF_SMTP_ENABLED=true
|
# GF_SMTP_ENABLED=true
|
||||||
# GF_SMTP_FROM_ADDRESS=grafana@example.com
|
# GF_SMTP_FROM_ADDRESS=grafana@example.com
|
||||||
# GF_SMTP_SKIP_VERIFY=false
|
# GF_SMTP_SKIP_VERIFY=false
|
||||||
# SECRET_GRAFANA_SMTP_PASSWORD_VERSION=v1
|
# SECRET_GF_SMTP_PASSWD_VERSION=v1
|
||||||
#
|
#
|
||||||
|
|
||||||
## Grafana Matrix Contact Point (optional)
|
## Grafana Matrix Contact Point (optional)
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.matrix-alertmanager-receiver.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.matrix-alertmanager-receiver.yml"
|
||||||
#SECRET_MATRIX_ACCESS_TOKEN_VERSION=v1
|
#SECRET_MATRIX_TOKEN_VERSION=v1
|
||||||
#GF_MATRIX_USER_ID="<user-id>"
|
#GF_MATRIX_USER_ID="<user-id>"
|
||||||
#GF_MATRIX_ROOM_ID="<room-id>"
|
#GF_MATRIX_ROOM_ID="<room-id>"
|
||||||
#GF_MATRIX_HOMESERVER_URL="<homeserver-url>"
|
#GF_MATRIX_HOMESERVER_URL="<homeserver-url>"
|
||||||
@ -83,3 +88,9 @@ ENABLE_BACKUPS=true
|
|||||||
#ALERT_BACKUP_NOT_SUCCESSFULL_ENABLED=true
|
#ALERT_BACKUP_NOT_SUCCESSFULL_ENABLED=true
|
||||||
#ALERT_NODE_DISK_SPACE_ENABLED=true
|
#ALERT_NODE_DISK_SPACE_ENABLED=true
|
||||||
#ALERT_NODE_MEMORY_USAGE_ENABLED=true
|
#ALERT_NODE_MEMORY_USAGE_ENABLED=true
|
||||||
|
|
||||||
|
# Forgejo metrics
|
||||||
|
# SECRET_FORGEJO_METRICS_TOKEN_VERSION=v1
|
||||||
|
# FORGEJO_METRICS_HOSTNAME=
|
||||||
|
# FORGEJO_INSECURE_SKIP_VERIFY=false
|
||||||
|
# COMPOSE_FILE="$COMPOSE_FILE:compose.forgejo.yml"
|
||||||
|
|||||||
13
README.md
13
README.md
@ -1,8 +1,8 @@
|
|||||||
# monitoring-ng
|
# monitoring-ng
|
||||||
|
|
||||||
Yet another monitoring stack ...
|
Yet another monitoring stack ...
|
||||||
This time its a all-in-one grafana/prometheus/loki/node_exporter/cadvisor/promtail stack.
|
This time its a all-in-one grafana/prometheus/loki/alloy stack.
|
||||||
It's based heavily on the [monitoring-lite](https://git.coopcloud.tech/coop-cloud/monitoring-lite) stack, but has everything in one recipe included now. So you can deploy monitoring instances to only gather metrics / logs (node_exporter/cadvisor/promtail) and also deploy instances with the full monitoring stack (grafana/prometheus/loki) with the same recipe and just different .env configuration.
|
It's based heavily on the [monitoring-lite](https://git.coopcloud.tech/coop-cloud/monitoring-lite) stack, but has everything in one recipe included now. So you can deploy monitoring instances to only gather metrics / logs (alloy) and also deploy instances with the full monitoring stack (grafana/prometheus/loki) with the same recipe and just different .env configuration.
|
||||||
|
|
||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
@ -47,13 +47,6 @@ Where gathering.org is the node you want to gather metrics from.
|
|||||||
- cadvisor.monitoring.gathering.org
|
- cadvisor.monitoring.gathering.org
|
||||||
- node.monitoring.gathering.org
|
- node.monitoring.gathering.org
|
||||||
|
|
||||||
### Expose node and cadvisor via ports instead of traefik
|
|
||||||
|
|
||||||
In case you have no traefik running on the machine, you can expose the ports directly by uncommenting the following line:
|
|
||||||
```
|
|
||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.expose-ports.yml"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Setup Metrics Browser
|
## Setup Metrics Browser
|
||||||
|
|
||||||
|
|
||||||
@ -145,7 +138,7 @@ COMPOSE_FILE="$COMPOSE_FILE:compose.matrix-alertmanager-receiver.yml"
|
|||||||
|
|
||||||
2. Insert the matrix access token secret:
|
2. Insert the matrix access token secret:
|
||||||
```
|
```
|
||||||
abra app secret insert monitoring.marx.klasse-methode.it matrix_access_token v1
|
abra app secret insert monitoring.marx.klasse-methode.it matrix_token v1
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Set required configurations:
|
3. Set required configurations:
|
||||||
|
|||||||
117
abra.sh
117
abra.sh
@ -1,27 +1,122 @@
|
|||||||
export ENTRYPOINT_VERSION=v1
|
export ENTRYPOINT_VERSION=v1
|
||||||
export GRAFANA_DATASOURCES_YML_VERSION=v1
|
export GF_DATASOURCES_VERSION=v1
|
||||||
export GRAFANA_DASHBOARDS_YML_VERSION=v2
|
export GF_DASHBOARDS_VERSION=v2
|
||||||
export GRAFANA_SWARM_DASHBOARD_JSON_VERSION=v2
|
export GF_SWARM_DASH_VERSION=v2
|
||||||
export GRAFANA_STACKS_DASHBOARD_JSON_VERSION=v2
|
export GF_STACKS_DASH_VERSION=v2
|
||||||
export GRAFANA_TRAEFIK_DASHBOARD_JSON_VERSION=v2
|
export GF_TRAEFIK_DASH_VERSION=v2
|
||||||
export GRAFANA_BACKUP_DASHBOARD_JSON_VERSION=v1
|
export GF_BACKUP_DASH_VERSION=v1
|
||||||
export GRAFANA_ALERTS_JSON_VERSION=v3
|
export GF_CUSTOM_INI_VERSION=v4
|
||||||
export GRAFANA_CUSTOM_INI_VERSION=v4
|
export LOKI_YML_VERSION=v3
|
||||||
export PROMTAIL_YML_VERSION=v3
|
|
||||||
export LOKI_YML_VERSION=v2
|
|
||||||
export PROMETHEUS_YML_VERSION=v2
|
export PROMETHEUS_YML_VERSION=v2
|
||||||
export MATRIX_ALERTMANAGER_CONFIG_VERSION=e
|
export MATRIX_ALERTMANAGER_CONFIG_VERSION=e
|
||||||
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=a
|
export MATRIX_ALERTMANAGER_ENTRYPOINT_VERSION=a
|
||||||
|
export GRAFANA_ALERTS_NODE_VERSION=v1c
|
||||||
|
export CONFIG_ALLOY_VERSION=v9
|
||||||
|
|
||||||
# creates a default prometheus scrape config for a given node
|
# creates a default prometheus scrape config for a given node
|
||||||
add_node(){
|
add_node(){
|
||||||
name=$1
|
name=$1
|
||||||
add_domain "$name" "$name:8082"
|
add_domain "$name" "metrics.traefik.$name"
|
||||||
add_domain "$name" "node.monitoring.$name"
|
add_domain "$name" "node.monitoring.$name"
|
||||||
add_domain "$name" "cadvisor.monitoring.$name"
|
add_domain "$name" "cadvisor.monitoring.$name"
|
||||||
cat "/prometheus/scrape_configs/$name.yml"
|
cat "/prometheus/scrape_configs/$name.yml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
# preview changes: abra app cmd --local <app> migrate_secret_names
|
||||||
|
# execute changes: abra app cmd --local <app> migrate_secret_names execute
|
||||||
|
migrate_secret_names() {
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
echo "jq is required on your local machine to migrate secret names"
|
||||||
|
echo "It could not be found in your PATH, please install jq to proceed."
|
||||||
|
echo "For example: On a debian/ubuntu system, run `apt install jq`"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Hardcoded migration mappings: old_secret_name|new_secret_name
|
||||||
|
MIGRATIONS="
|
||||||
|
grafana_admin_password|gf_adminpasswd
|
||||||
|
grafana_smtp_password|gf_smtp_passwd
|
||||||
|
grafana_oidc_client_secret|gf_oidc_secret
|
||||||
|
matrix_access_token|matrix_token
|
||||||
|
loki_aws_secret_access_key|loki_aws_key
|
||||||
|
"
|
||||||
|
|
||||||
|
# Determine which server the app is deployed on
|
||||||
|
SERVER=$(abra app ls -m | jq -r --arg domain "$APP_NAME" '[.[].apps[] | select(.domain == $domain) | .server] | first' 2>/dev/null)
|
||||||
|
|
||||||
|
if [ -z "$SERVER" ]; then
|
||||||
|
echo "Error: could not determine server for app '$APP_NAME'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build a lookup table of all secrets currently mounted in this stack.
|
||||||
|
# Each line: <secretID> <containerID> <secretName>
|
||||||
|
LOOKUP=$(ssh "$SERVER" "
|
||||||
|
docker stack services ${STACK_NAME} --format '{{.Name}}' | while read svc; do
|
||||||
|
CID=\$(docker ps --no-trunc -q --filter \"name=\${svc}\" | head -1)
|
||||||
|
docker service inspect \"\$svc\" --format '{{json .Spec.TaskTemplate.ContainerSpec.Secrets}}' | \
|
||||||
|
jq -r --arg cid \"\$CID\" '.[]? | .SecretID + \" \" + \$cid + \" \" + .SecretName'
|
||||||
|
done | sort -k3 -r
|
||||||
|
" 2>/dev/null)
|
||||||
|
|
||||||
|
echo "Secret migration plan for: $APP_NAME (server: $SERVER)"
|
||||||
|
echo ""
|
||||||
|
printf " %-24s %-8s %s\n" "OLD NAME" "FOUND" "ACTION"
|
||||||
|
printf " %-24s %-8s %s\n" "--------" "-----" "------"
|
||||||
|
|
||||||
|
# Check each old name against the lookup table and display the plan
|
||||||
|
ANY_FOUND=false
|
||||||
|
while IFS='|' read -r OLD_NAME NEW_NAME; do
|
||||||
|
[ -z "$OLD_NAME" ] && continue
|
||||||
|
MATCH=$(echo "$LOOKUP" | grep " ${STACK_NAME}_${OLD_NAME}_" | head -1)
|
||||||
|
if [ -n "$MATCH" ]; then
|
||||||
|
printf " %-24s %-8s %s\n" "$OLD_NAME" "yes" "recreate as '$NEW_NAME' version V1"
|
||||||
|
ANY_FOUND=true
|
||||||
|
else
|
||||||
|
printf " %-24s %-8s %s\n" "$OLD_NAME" "no" "nothing (not found on server)"
|
||||||
|
fi
|
||||||
|
done <<< "$MIGRATIONS"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ "$ANY_FOUND" = false ]; then
|
||||||
|
echo "No old secrets found on server. Nothing to migrate."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" != "execute" ]; then
|
||||||
|
echo "To apply the above changes, run:"
|
||||||
|
echo " abra app cmd --local $APP_NAME migrate_secret_names execute"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# read each found secret from its container and re-insert with the new name
|
||||||
|
while IFS='|' read -r OLD_NAME NEW_NAME; do
|
||||||
|
[ -z "$OLD_NAME" ] && continue
|
||||||
|
|
||||||
|
MATCH=$(echo "$LOOKUP" | grep " ${STACK_NAME}_${OLD_NAME}_" | head -1)
|
||||||
|
[ -z "$MATCH" ] && continue
|
||||||
|
|
||||||
|
SECRET_ID=$(echo "$MATCH" | awk '{print $1}')
|
||||||
|
CID=$(echo "$MATCH" | awk '{print $2}')
|
||||||
|
SECRET_VALUE=$(ssh "$SERVER" "cat /var/lib/docker/containers/${CID}/mounts/secrets/${SECRET_ID} 2>/dev/null || sudo cat /var/lib/docker/containers/${CID}/mounts/secrets/${SECRET_ID} 2>/dev/null")
|
||||||
|
|
||||||
|
if [ -z "$SECRET_VALUE" ]; then
|
||||||
|
echo "Error: could not read value for '$OLD_NAME', skipping"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Migrating: '$OLD_NAME' -> '$NEW_NAME' (v1)"
|
||||||
|
printf '%s' "$SECRET_VALUE" | abra app secret insert -C "$APP_NAME" "$NEW_NAME" v1
|
||||||
|
|
||||||
|
done <<< "$MIGRATIONS"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Done."
|
||||||
|
}
|
||||||
|
|
||||||
# adds a domain to a scrape config or creates a new one
|
# adds a domain to a scrape config or creates a new one
|
||||||
add_domain(){
|
add_domain(){
|
||||||
name=$1
|
name=$1
|
||||||
|
|||||||
@ -12,7 +12,7 @@ http:
|
|||||||
matrix:
|
matrix:
|
||||||
homeserver-url: "{{ env "GF_MATRIX_HOMESERVER_URL" }}"
|
homeserver-url: "{{ env "GF_MATRIX_HOMESERVER_URL" }}"
|
||||||
user-id: "{{ env "GF_MATRIX_USER_ID" }}"
|
user-id: "{{ env "GF_MATRIX_USER_ID" }}"
|
||||||
access-token: "{{ secret "matrix_access_token" }}"
|
access-token: "{{ secret "matrix_token" }}"
|
||||||
room-mapping:
|
room-mapping:
|
||||||
matrixroom: "{{ env "GF_MATRIX_ROOM_ID" }}"
|
matrixroom: "{{ env "GF_MATRIX_ROOM_ID" }}"
|
||||||
|
|
||||||
|
|||||||
131
alerts/node.yml.tmpl
Normal file
131
alerts/node.yml.tmpl
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
# List of alert rule UIDs that should be deleted
|
||||||
|
deleteRules:
|
||||||
|
{{ if ne (env "ALERT_NODE_DISK_SPACE_ENABLED") "true" }}
|
||||||
|
- orgId: 1
|
||||||
|
uid: bds8bhxu97pxca
|
||||||
|
{{ end }}
|
||||||
|
{{ if ne (env "ALERT_NODE_MEMORY_USAGE_ENABLED") "true" }}
|
||||||
|
- orgId: 1
|
||||||
|
uid: ads8cswmly96oa
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
groups:
|
||||||
|
- orgId: 1
|
||||||
|
name: node
|
||||||
|
folder: node
|
||||||
|
interval: 5m
|
||||||
|
rules:
|
||||||
|
{{ if eq (env "ALERT_NODE_DISK_SPACE_ENABLED") "true" }}
|
||||||
|
- uid: bds8bhxu97pxca
|
||||||
|
title: Node Disk Space
|
||||||
|
condition: C
|
||||||
|
data:
|
||||||
|
- refId: A
|
||||||
|
relativeTimeRange:
|
||||||
|
from: 600
|
||||||
|
to: 0
|
||||||
|
datasourceUid: PBFA97CFB590B2093
|
||||||
|
model:
|
||||||
|
editorMode: code
|
||||||
|
expr: (node_filesystem_free_bytes{fstype="ext4"} / node_filesystem_size_bytes{fstype="ext4"}) * 100
|
||||||
|
instant: true
|
||||||
|
intervalMs: 1000
|
||||||
|
legendFormat: __auto
|
||||||
|
maxDataPoints: 43200
|
||||||
|
range: false
|
||||||
|
refId: A
|
||||||
|
- refId: C
|
||||||
|
relativeTimeRange:
|
||||||
|
from: 600
|
||||||
|
to: 0
|
||||||
|
datasourceUid: __expr__
|
||||||
|
model:
|
||||||
|
conditions:
|
||||||
|
- evaluator:
|
||||||
|
params:
|
||||||
|
- 10
|
||||||
|
type: lt
|
||||||
|
operator:
|
||||||
|
type: and
|
||||||
|
query:
|
||||||
|
params:
|
||||||
|
- C
|
||||||
|
reducer:
|
||||||
|
params: []
|
||||||
|
type: last
|
||||||
|
type: query
|
||||||
|
datasource:
|
||||||
|
type: __expr__
|
||||||
|
uid: __expr__
|
||||||
|
expression: A
|
||||||
|
intervalMs: 1000
|
||||||
|
maxDataPoints: 43200
|
||||||
|
refId: C
|
||||||
|
type: threshold
|
||||||
|
noDataState: NoData
|
||||||
|
execErrState: Error
|
||||||
|
for: 5m
|
||||||
|
annotations:
|
||||||
|
description: ""
|
||||||
|
runbook_url: ""
|
||||||
|
summary: Less than 10% disk space left on {{`{{ $labels.instance }}`}} ({{`{{ (index $values "A").Value }}`}}% left)
|
||||||
|
labels:
|
||||||
|
"": ""
|
||||||
|
isPaused: false
|
||||||
|
{{ end }}
|
||||||
|
{{ if eq (env "ALERT_NODE_MEMORY_USAGE_ENABLED") "true" }}
|
||||||
|
- uid: ads8cswmly96oa
|
||||||
|
title: Node Memory Usage
|
||||||
|
condition: C
|
||||||
|
data:
|
||||||
|
- refId: A
|
||||||
|
relativeTimeRange:
|
||||||
|
from: 600
|
||||||
|
to: 0
|
||||||
|
datasourceUid: PBFA97CFB590B2093
|
||||||
|
model:
|
||||||
|
editorMode: code
|
||||||
|
expr: (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * 100
|
||||||
|
instant: true
|
||||||
|
intervalMs: 1000
|
||||||
|
legendFormat: __auto
|
||||||
|
maxDataPoints: 43200
|
||||||
|
range: false
|
||||||
|
refId: A
|
||||||
|
- refId: C
|
||||||
|
relativeTimeRange:
|
||||||
|
from: 600
|
||||||
|
to: 0
|
||||||
|
datasourceUid: __expr__
|
||||||
|
model:
|
||||||
|
conditions:
|
||||||
|
- evaluator:
|
||||||
|
params:
|
||||||
|
- 85
|
||||||
|
type: gt
|
||||||
|
operator:
|
||||||
|
type: and
|
||||||
|
query:
|
||||||
|
params:
|
||||||
|
- C
|
||||||
|
reducer:
|
||||||
|
params: []
|
||||||
|
type: last
|
||||||
|
type: query
|
||||||
|
datasource:
|
||||||
|
type: __expr__
|
||||||
|
uid: __expr__
|
||||||
|
expression: A
|
||||||
|
intervalMs: 1000
|
||||||
|
maxDataPoints: 43200
|
||||||
|
refId: C
|
||||||
|
type: threshold
|
||||||
|
noDataState: NoData
|
||||||
|
execErrState: Error
|
||||||
|
for: 5m
|
||||||
|
annotations:
|
||||||
|
summary: Memory usage is above 85% on {{`{{ $labels.instance }}`}} ({{`{{ printf "%.2f" (index $values "A").Value }}`}}% usage)
|
||||||
|
isPaused: false
|
||||||
|
{{ end }}
|
||||||
@ -1,13 +0,0 @@
|
|||||||
---
|
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
ports:
|
|
||||||
- "9100:9100"
|
|
||||||
deploy:
|
|
||||||
|
|
||||||
cadvisor:
|
|
||||||
ports:
|
|
||||||
- "9101:8080"
|
|
||||||
deploy:
|
|
||||||
10
compose.forgejo.yml
Normal file
10
compose.forgejo.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
secrets:
|
||||||
|
- forgejo_token
|
||||||
|
secrets:
|
||||||
|
forgejo_token:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_forgejo_token_${SECRET_FORGEJO_METRICS_TOKEN_VERSION}
|
||||||
17
compose.grafana-oidc.yml
Normal file
17
compose.grafana-oidc.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
secrets:
|
||||||
|
- gf_oidc_secret
|
||||||
|
environment:
|
||||||
|
- OIDC_API_URL
|
||||||
|
- OIDC_AUTH_URL
|
||||||
|
- OIDC_CLIENT_ID
|
||||||
|
- OIDC_ENABLED
|
||||||
|
- OIDC_TOKEN_URL
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
gf_oidc_secret:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_gf_oidc_secret_${SECRET_GF_OIDC_SECRET_VERSION}
|
||||||
18
compose.grafana-smtp.yml
Normal file
18
compose.grafana-smtp.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
secrets:
|
||||||
|
- gf_smtp_passwd
|
||||||
|
environment:
|
||||||
|
- GF_SMTP_HOST
|
||||||
|
- GF_SMTP_USER
|
||||||
|
- GF_SMTP_PASSWORD__FILE=/run/secrets/gf_smtp_passwd
|
||||||
|
- GF_SMTP_ENABLED
|
||||||
|
- GF_SMTP_FROM_ADDRESS
|
||||||
|
- GF_SMTP_SKIP_VERIFY
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
gf_smtp_passwd:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_gf_smtp_passwd_${SECRET_GF_SMTP_PASSWD_VERSION}
|
||||||
@ -2,104 +2,87 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana:10.4.14
|
image: grafana/grafana:12.4.3
|
||||||
volumes:
|
volumes:
|
||||||
- grafana-data:/var/lib/grafana:rw
|
- grafana-data:/var/lib/grafana:rw
|
||||||
secrets:
|
secrets:
|
||||||
- grafana_admin_password
|
- gf_adminpasswd
|
||||||
- grafana_oidc_client_secret
|
|
||||||
- grafana_smtp_password
|
|
||||||
configs:
|
configs:
|
||||||
- source: grafana_custom_ini
|
- source: gf_custom_ini
|
||||||
target: /etc/grafana/grafana.ini
|
target: /etc/grafana/grafana.ini
|
||||||
- source: grafana_datasources_yml
|
- source: gf_datasources
|
||||||
target: /etc/grafana/provisioning/datasources/datasources.yml
|
target: /etc/grafana/provisioning/datasources/datasources.yml
|
||||||
- source: grafana_dashboards_yml
|
- source: gf_dashboards
|
||||||
target: /etc/grafana/provisioning/dashboards/dashboards.yml
|
target: /etc/grafana/provisioning/dashboards/dashboards.yml
|
||||||
- source: grafana_swarm_dashboard_json
|
- source: gf_swarm_dash
|
||||||
target: /var/lib/grafana/dashboards/docker-swarm-nodes.json
|
target: /var/lib/grafana/dashboards/docker-swarm-nodes.json
|
||||||
- source: grafana_stacks_dashboard_json
|
- source: gf_stacks_dash
|
||||||
target: /var/lib/grafana/dashboards/docker-swarm-stacks.json
|
target: /var/lib/grafana/dashboards/docker-swarm-stacks.json
|
||||||
- source: grafana_traefik_dashboard_json
|
- source: gf_traefik_dash
|
||||||
target: /var/lib/grafana/dashboards/traefik.json
|
target: /var/lib/grafana/dashboards/traefik.json
|
||||||
- source: grafana_backup_dashboard_json
|
- source: gf_backup_dash
|
||||||
target: /var/lib/grafana/dashboards/backup.json
|
target: /var/lib/grafana/dashboards/backup.json
|
||||||
- source: grafana_alerts_json
|
- source: gf_alerts_node
|
||||||
target: /var/lib/grafana/alerts/alerts.json
|
target: /etc/grafana/provisioning/alerting/node.yml
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
- internal
|
- internal
|
||||||
environment:
|
environment:
|
||||||
- GF_SERVER_ROOT_URL
|
- GF_SERVER_ROOT_URL
|
||||||
- GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/grafana_admin_password
|
- GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/gf_adminpasswd
|
||||||
- GF_SMTP_HOST
|
|
||||||
- GF_SMTP_USER
|
|
||||||
- GF_SMTP_PASSWORD__FILE=/run/secrets/grafana_smtp_password
|
|
||||||
- GF_SMTP_ENABLED
|
|
||||||
- GF_SMTP_FROM_ADDRESS
|
|
||||||
- GF_SMTP_SKIP_VERIFY
|
|
||||||
- GF_SECURITY_ALLOW_EMBEDDING
|
- GF_SECURITY_ALLOW_EMBEDDING
|
||||||
- GF_INSTALL_PLUGINS
|
- GF_INSTALL_PLUGINS
|
||||||
- OIDC_API_URL
|
- ALERT_NODE_DISK_SPACE_ENABLED
|
||||||
- OIDC_AUTH_URL
|
- ALERT_NODE_MEMORY_USAGE_ENABLED
|
||||||
- OIDC_CLIENT_ID
|
|
||||||
- OIDC_ENABLED
|
|
||||||
- OIDC_TOKEN_URL
|
|
||||||
deploy:
|
deploy:
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=proxy"
|
- "traefik.swarm.network=proxy"
|
||||||
- "traefik.http.services.${STACK_NAME}-grafana.loadbalancer.server.port=3000"
|
- "traefik.http.services.${STACK_NAME}-grafana.loadbalancer.server.port=3000"
|
||||||
- "traefik.http.routers.${STACK_NAME}-grafana.rule=Host(`${GRAFANA_DOMAIN:-$DOMAIN}`)"
|
- "traefik.http.routers.${STACK_NAME}-grafana.rule=Host(`${DOMAIN}`)"
|
||||||
- "traefik.http.routers.${STACK_NAME}-grafana.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}-grafana.entrypoints=web-secure"
|
||||||
- "traefik.http.routers.${STACK_NAME}-grafana.tls=true"
|
- "traefik.http.routers.${STACK_NAME}-grafana.tls=true"
|
||||||
- "traefik.http.routers.${STACK_NAME}-grafana.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}-grafana.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: "wget -q http://localhost:3000/ -O/dev/null"
|
test: "wget -q http://localhost:3000/healthz -O/dev/null"
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
grafana_custom_ini:
|
gf_custom_ini:
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
name: ${STACK_NAME}_grafana_custom_ini_${GRAFANA_CUSTOM_INI_VERSION}
|
name: ${STACK_NAME}_gf_custom_ini_${GF_CUSTOM_INI_VERSION}
|
||||||
file: grafana_custom.ini
|
file: grafana_custom.ini
|
||||||
grafana_datasources_yml:
|
gf_datasources:
|
||||||
name: ${STACK_NAME}_g_datasources_yml_${GRAFANA_DATASOURCES_YML_VERSION}
|
name: ${STACK_NAME}_gf_datasources_${GF_DATASOURCES_VERSION}
|
||||||
file: grafana-datasources.yml
|
file: grafana-datasources.yml
|
||||||
grafana_dashboards_yml:
|
gf_dashboards:
|
||||||
name: ${STACK_NAME}_g_dashboards_yml_${GRAFANA_DASHBOARDS_YML_VERSION}
|
name: ${STACK_NAME}_gf_dashboards_${GF_DASHBOARDS_VERSION}
|
||||||
file: grafana-dashboards.yml
|
file: grafana-dashboards.yml
|
||||||
grafana_swarm_dashboard_json:
|
gf_swarm_dash:
|
||||||
name: ${STACK_NAME}_g_swarm_dashboard_json_${GRAFANA_SWARM_DASHBOARD_JSON_VERSION}
|
name: ${STACK_NAME}_gf_swarm_dash_${GF_SWARM_DASH_VERSION}
|
||||||
file: grafana-swarm-dashboard.json
|
file: grafana-swarm-dashboard.json
|
||||||
grafana_stacks_dashboard_json:
|
gf_stacks_dash:
|
||||||
name: ${STACK_NAME}_g_stacks_dashboard_json_${GRAFANA_STACKS_DASHBOARD_JSON_VERSION}
|
name: ${STACK_NAME}_gf_stacks_dash_${GF_STACKS_DASH_VERSION}
|
||||||
file: grafana-stacks-dashboard.json
|
file: grafana-stacks-dashboard.json
|
||||||
grafana_traefik_dashboard_json:
|
gf_traefik_dash:
|
||||||
name: ${STACK_NAME}_g_traefik_dashboard_json_${GRAFANA_TRAEFIK_DASHBOARD_JSON_VERSION}
|
name: ${STACK_NAME}_gf_traefik_dash_${GF_TRAEFIK_DASH_VERSION}
|
||||||
file: grafana-traefik-dashboard.json
|
file: grafana-traefik-dashboard.json
|
||||||
grafana_backup_dashboard_json:
|
gf_backup_dash:
|
||||||
name: ${STACK_NAME}_g_backup_dashboard_json_${GRAFANA_BACKUP_DASHBOARD_JSON_VERSION}
|
name: ${STACK_NAME}_gf_backup_dash_${GF_BACKUP_DASH_VERSION}
|
||||||
file: grafana-backup-dashboard.json
|
file: grafana-backup-dashboard.json
|
||||||
grafana_alerts_json:
|
gf_alerts_node:
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
name: ${STACK_NAME}_g_alerts_json_${GRAFANA_ALERTS_JSON_VERSION}
|
name: ${STACK_NAME}_gf_alerts_node_${GRAFANA_ALERTS_NODE_VERSION}
|
||||||
file: grafana-alerts.json.tmpl
|
file: alerts/node.yml.tmpl
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
grafana-data:
|
grafana-data:
|
||||||
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
grafana_admin_password:
|
gf_adminpasswd:
|
||||||
external: true
|
external: true
|
||||||
name: ${STACK_NAME}_grafana_admin_password_${SECRET_GRAFANA_ADMIN_PASSWORD_VERSION}
|
name: ${STACK_NAME}_gf_adminpasswd_${SECRET_GF_ADMINPASSWD_VERSION}
|
||||||
grafana_oidc_client_secret:
|
|
||||||
external: true
|
|
||||||
name: ${STACK_NAME}_grafana_oidc_client_secret_${SECRET_GRAFANA_OIDC_CLIENT_SECRET_VERSION}
|
|
||||||
grafana_smtp_password:
|
|
||||||
external: true
|
|
||||||
name: ${STACK_NAME}_grafana_smtp_password_${SECRET_GRAFANA_SMTP_PASSWORD_VERSION}
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
loki:
|
loki:
|
||||||
image: grafana/loki:2.9.11
|
image: grafana/loki:3.7.2
|
||||||
command: -config.file=/etc/loki/local-config.yaml
|
command: -config.file=/etc/loki/local-config.yaml
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
@ -12,7 +12,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- loki-data:/loki
|
- loki-data:/loki
|
||||||
# secrets:
|
# secrets:
|
||||||
# - loki_aws_secret_access_key
|
# - loki_aws_key
|
||||||
environment:
|
environment:
|
||||||
- LOKI_ACCESS_KEY_ID
|
- LOKI_ACCESS_KEY_ID
|
||||||
- LOKI_AWS_ENDPOINT
|
- LOKI_AWS_ENDPOINT
|
||||||
@ -27,7 +27,7 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=proxy"
|
- "traefik.swarm.network=proxy"
|
||||||
- "traefik.http.services.${STACK_NAME}-loki.loadbalancer.server.port=3100"
|
- "traefik.http.services.${STACK_NAME}-loki.loadbalancer.server.port=3100"
|
||||||
- "traefik.http.routers.${STACK_NAME}-loki.rule=Host(`loki.${DOMAIN}`)"
|
- "traefik.http.routers.${STACK_NAME}-loki.rule=Host(`loki.${DOMAIN}`)"
|
||||||
- "traefik.http.routers.${STACK_NAME}-loki.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}-loki.entrypoints=web-secure"
|
||||||
@ -47,6 +47,6 @@ volumes:
|
|||||||
loki-data:
|
loki-data:
|
||||||
|
|
||||||
# secrets:
|
# secrets:
|
||||||
# loki_aws_secret_access_key:
|
# loki_aws_key:
|
||||||
# external: true
|
# external: true
|
||||||
# name: ${STACK_NAME}_loki_aws_secret_access_key_${SECRET_LOKI_AWS_SECRET_ACCESS_KEY_VERSION}
|
# name: ${STACK_NAME}_loki_aws_key_${SECRET_LOKI_AWS_KEY_VERSION}
|
||||||
|
|||||||
@ -2,9 +2,9 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
matrix-alertmanager-receiver:
|
matrix-alertmanager-receiver:
|
||||||
image: metio/matrix-alertmanager-receiver:2025.2.9
|
image: metio/matrix-alertmanager-receiver:2026.2.25
|
||||||
secrets:
|
secrets:
|
||||||
- matrix_access_token
|
- matrix_token
|
||||||
configs:
|
configs:
|
||||||
- source: matrix-alertmanager-receiver-config
|
- source: matrix-alertmanager-receiver-config
|
||||||
target: /etc/matrix-alertmanager-receiver/config.yml
|
target: /etc/matrix-alertmanager-receiver/config.yml
|
||||||
@ -23,6 +23,6 @@ configs:
|
|||||||
file: alertmanager-matrix-config.yml.tmpl
|
file: alertmanager-matrix-config.yml.tmpl
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
matrix_access_token:
|
matrix_token:
|
||||||
external: true
|
external: true
|
||||||
name: ${STACK_NAME}_matrix_access_token_${SECRET_MATRIX_ACCESS_TOKEN_VERSION}
|
name: ${STACK_NAME}_matrix_token_${SECRET_MATRIX_TOKEN_VERSION}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
prometheus:
|
prometheus:
|
||||||
image: prom/prometheus:v2.55.1
|
image: prom/prometheus:v3.12.0
|
||||||
secrets:
|
secrets:
|
||||||
- basic_auth
|
- basic_auth
|
||||||
volumes:
|
volumes:
|
||||||
@ -16,6 +16,8 @@ services:
|
|||||||
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
|
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
|
||||||
- "--web.console.templates=/usr/share/prometheus/consoles"
|
- "--web.console.templates=/usr/share/prometheus/consoles"
|
||||||
- "--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME}"
|
- "--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME}"
|
||||||
|
- "--enable-feature=remote-write-receiver"
|
||||||
|
- "--web.enable-remote-write-receiver"
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
- internal
|
- internal
|
||||||
@ -24,12 +26,13 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=proxy"
|
- "traefik.swarm.network=proxy"
|
||||||
- "traefik.http.services.${STACK_NAME}-prometheus.loadbalancer.server.port=9090"
|
- "traefik.http.services.${STACK_NAME}-prometheus.loadbalancer.server.port=9090"
|
||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.rule=Host(`prometheus.${DOMAIN}`)"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.rule=Host(`prometheus.${DOMAIN}`)"
|
||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure"
|
||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
|
||||||
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
|
- "traefik.http.routers.${STACK_NAME}-prometheus.middlewares=basicauth@file"
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
prometheus_yml:
|
prometheus_yml:
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
promtail:
|
|
||||||
image: grafana/promtail:2.9.11
|
|
||||||
volumes:
|
|
||||||
- /var/log:/var/log:ro
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
command: -config.file=/etc/promtail/config.yml
|
|
||||||
configs:
|
|
||||||
- source: promtail_yml
|
|
||||||
target: /etc/promtail/config.yml
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
secrets:
|
|
||||||
- basic_auth
|
|
||||||
environment:
|
|
||||||
- DOMAIN
|
|
||||||
- LOKI_PUSH_URL
|
|
||||||
|
|
||||||
configs:
|
|
||||||
promtail_yml:
|
|
||||||
name: ${STACK_NAME}_promtail_yml_${PROMTAIL_YML_VERSION}
|
|
||||||
file: promtail.yml.tmpl
|
|
||||||
template_driver: golang
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
basic_auth:
|
|
||||||
external: true
|
|
||||||
name: ${STACK_NAME}_basic_auth_${SECRET_BASIC_AUTH_VERSION}
|
|
||||||
@ -2,7 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
pushgateway:
|
pushgateway:
|
||||||
image: prom/pushgateway:v1.10.0
|
image: prom/pushgateway:v1.11.2
|
||||||
command:
|
command:
|
||||||
- '--web.listen-address=:9191'
|
- '--web.listen-address=:9191'
|
||||||
- '--push.disable-consistency-check'
|
- '--push.disable-consistency-check'
|
||||||
@ -17,7 +17,7 @@ services:
|
|||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.docker.network=proxy"
|
- "traefik.swarm.network=proxy"
|
||||||
- "traefik.http.services.${STACK_NAME}-pushgateway.loadbalancer.server.port=9191"
|
- "traefik.http.services.${STACK_NAME}-pushgateway.loadbalancer.server.port=9191"
|
||||||
- "traefik.http.routers.${STACK_NAME}-pushgateway.rule=Host(`pushgateway.${DOMAIN}`)"
|
- "traefik.http.routers.${STACK_NAME}-pushgateway.rule=Host(`pushgateway.${DOMAIN}`)"
|
||||||
- "traefik.http.routers.${STACK_NAME}-pushgateway.entrypoints=web-secure"
|
- "traefik.http.routers.${STACK_NAME}-pushgateway.entrypoints=web-secure"
|
||||||
|
|||||||
6
compose.syslog.yml
Normal file
6
compose.syslog.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
ports:
|
||||||
|
- "514:514"
|
||||||
101
compose.yml
101
compose.yml
@ -3,89 +3,46 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: prom/node-exporter:v1.8.1
|
image: grafana/alloy:v1.16.1
|
||||||
user: root
|
hostname: "${DOMAIN}"
|
||||||
environment:
|
|
||||||
- NODE_ID={{.Node.ID}}
|
|
||||||
volumes:
|
|
||||||
- /proc:/host/proc:ro
|
|
||||||
- /sys:/host/sys:ro
|
|
||||||
- /:/rootfs:ro
|
|
||||||
- /etc/hostname:/etc/nodename:ro
|
|
||||||
command:
|
|
||||||
- "--path.sysfs=/host/sys"
|
|
||||||
- "--path.procfs=/host/proc"
|
|
||||||
- "--path.rootfs=/rootfs"
|
|
||||||
- "--collector.textfile.directory=/etc/node-exporter/"
|
|
||||||
- "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)"
|
|
||||||
- "--no-collector.ipvs"
|
|
||||||
configs:
|
configs:
|
||||||
- source: entrypoint
|
- source: config_alloy
|
||||||
target: /entrypoint.sh
|
target: /etc/alloy/config.alloy
|
||||||
|
volumes:
|
||||||
|
- /:/rootfs:ro
|
||||||
|
- /var/run:/var/run:rw
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- /sys:/sys:ro
|
||||||
|
- /var/lib/docker:/var/lib/docker:ro
|
||||||
|
- /dev:/dev:ro
|
||||||
|
- alloy-data:/var/lib/alloy/data
|
||||||
|
command:
|
||||||
|
- "run"
|
||||||
|
- "--storage.path=/var/lib/alloy/data"
|
||||||
|
- "/etc/alloy/config.alloy"
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- proxy
|
secrets:
|
||||||
entrypoint: [ "/bin/sh", "-e", "/entrypoint.sh" ]
|
- basic_auth
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=false"
|
||||||
- "traefik.docker.network=proxy"
|
|
||||||
- "traefik.http.services.${STACK_NAME}-node.loadbalancer.server.port=9100"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-node.rule=Host(`node.${DOMAIN}`)"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-node.entrypoints=web-secure"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-node.tls=true"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-node.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-node.middlewares=basicauth@file"
|
|
||||||
- "coop-cloud.${STACK_NAME}.version=1.6.0+v1.8.1"
|
- "coop-cloud.${STACK_NAME}.version=1.6.0+v1.8.1"
|
||||||
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
|
|
||||||
|
|
||||||
cadvisor:
|
|
||||||
image: gcr.io/cadvisor/cadvisor:v0.49.2
|
|
||||||
command:
|
|
||||||
- "-logtostderr"
|
|
||||||
- "--enable_metrics=cpu,cpuLoad,disk,diskIO,process,memory,network"
|
|
||||||
# all possible metrics: advtcp,app,cpu,cpuLoad,cpu_topology,cpuset,disk,diskIO,hugetlb,memory,memory_numa,network,oom_event,percpu,perf_event,process,referenced_memory,resctrl,sched,tcp,udp.
|
|
||||||
- "--housekeeping_interval=120s"
|
|
||||||
- "--docker_only=true"
|
|
||||||
volumes:
|
|
||||||
- /var/lib/docker/:/var/lib/docker:ro
|
|
||||||
- /dev/disk/:/dev/disk:ro
|
|
||||||
- /sys:/sys:ro
|
|
||||||
- /var/run:/var/run:ro
|
|
||||||
- /:/rootfs:ro
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
- proxy
|
|
||||||
deploy:
|
|
||||||
restart_policy:
|
|
||||||
condition: on-failure
|
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.docker.network=proxy"
|
|
||||||
- "traefik.http.services.${STACK_NAME}-cadvisor.loadbalancer.server.port=8080"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-cadvisor.rule=Host(`cadvisor.${DOMAIN}`)"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-cadvisor.entrypoints=web-secure"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-cadvisor.tls=true"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-cadvisor.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}-cadvisor.middlewares=basicauth@file"
|
|
||||||
healthcheck:
|
|
||||||
test: wget --quiet --tries=1 --spider http://localhost:8080/healthz || exit 1
|
|
||||||
interval: 15s
|
|
||||||
timeout: 15s
|
|
||||||
retries: 5
|
|
||||||
start_period: 30s
|
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
entrypoint:
|
config_alloy:
|
||||||
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
|
template_driver: golang
|
||||||
file: node-exporter-entrypoint.sh
|
name: ${STACK_NAME}_config_alloy_${CONFIG_ALLOY_VERSION}
|
||||||
|
file: config.alloy.tmpl
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
internal:
|
internal:
|
||||||
|
volumes:
|
||||||
|
alloy-data:
|
||||||
|
secrets:
|
||||||
|
basic_auth:
|
||||||
|
external: true
|
||||||
|
name: ${STACK_NAME}_basic_auth_${SECRET_BASIC_AUTH_VERSION}
|
||||||
|
|||||||
108
config.alloy.tmpl
Normal file
108
config.alloy.tmpl
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
logging {
|
||||||
|
level = "info"
|
||||||
|
format = "logfmt"
|
||||||
|
}
|
||||||
|
|
||||||
|
discovery.docker "linux" {
|
||||||
|
host = "unix:///var/run/docker.sock"
|
||||||
|
}
|
||||||
|
|
||||||
|
{{ if ne (env "PROMETHEUS_REMOTE_WRITE_URL") "" }}
|
||||||
|
prometheus.exporter.cadvisor "docker" {
|
||||||
|
}
|
||||||
|
|
||||||
|
prometheus.exporter.unix "default" {
|
||||||
|
include_exporter_metrics = true
|
||||||
|
rootfs_path = "/rootfs"
|
||||||
|
}
|
||||||
|
|
||||||
|
prometheus.scrape "default" {
|
||||||
|
targets = array.concat(
|
||||||
|
[{
|
||||||
|
job = "alloy",
|
||||||
|
__address__ = "127.0.0.1:12345",
|
||||||
|
}],
|
||||||
|
prometheus.exporter.unix.default.targets,
|
||||||
|
prometheus.exporter.cadvisor.docker.targets,
|
||||||
|
)
|
||||||
|
|
||||||
|
forward_to = [prometheus.remote_write.prometheus.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
{{ if ne (env "FORGEJO_METRICS_HOSTNAME") "" }}
|
||||||
|
prometheus.scrape "forgejo" {
|
||||||
|
bearer_token = "{{ secret "forgejo_token" }}"
|
||||||
|
job_name = "forgejo"
|
||||||
|
scheme = "https"
|
||||||
|
|
||||||
|
targets = [{ __address__ = "{{ env "FORGEJO_METRICS_HOSTNAME" }}" }]
|
||||||
|
forward_to = [prometheus.remote_write.prometheus.receiver]
|
||||||
|
|
||||||
|
tls_config {
|
||||||
|
insecure_skip_verify = {{ env "FORGEJO_INSECURE_SKIP_VERIFY" }}
|
||||||
|
server_name = "{{ env "FORGEJO_METRICS_HOSTNAME" }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
prometheus.remote_write "prometheus" {
|
||||||
|
endpoint {
|
||||||
|
url = "{{ env "PROMETHEUS_REMOTE_WRITE_URL" }}"
|
||||||
|
|
||||||
|
basic_auth {
|
||||||
|
username = "admin"
|
||||||
|
password = "{{ secret "basic_auth" }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if ne (env "LOKI_PUSH_URL") "" }}
|
||||||
|
loki.source.docker "docker" {
|
||||||
|
host = "unix:///var/run/docker.sock"
|
||||||
|
targets = discovery.docker.linux.targets
|
||||||
|
labels = {"app" = "docker"}
|
||||||
|
forward_to = [loki.write.loki.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
{{ if eq (env "JOURNALD") "1" }}
|
||||||
|
loki.source.journal "journal" {
|
||||||
|
path = "/var/log/journal"
|
||||||
|
labels = { job = "{{ env "DOMAIN" }}" }
|
||||||
|
forward_to = [loki.write.loki.receiver]
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if eq (env "SYSLOG") "1" }}
|
||||||
|
loki.relabel "syslog" {
|
||||||
|
rule {
|
||||||
|
action = "labelmap"
|
||||||
|
regex = "__syslog_(.+)"
|
||||||
|
}
|
||||||
|
|
||||||
|
forward_to = []
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.source.syslog "syslog" {
|
||||||
|
listener {
|
||||||
|
address = "[::1]:514"
|
||||||
|
label_structured_data = true
|
||||||
|
labels = { component = "loki.source.syslog" }
|
||||||
|
}
|
||||||
|
|
||||||
|
relabel_rules = loki.relabel.syslog.rules
|
||||||
|
forward_to = [loki.write.loki.receiver]
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
loki.write "loki" {
|
||||||
|
endpoint {
|
||||||
|
url = "{{ env "LOKI_PUSH_URL" }}"
|
||||||
|
|
||||||
|
basic_auth {
|
||||||
|
username = "admin"
|
||||||
|
password = "{{ secret "basic_auth" }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
@ -216,7 +216,7 @@
|
|||||||
"datasourceUid": "PBFA97CFB590B2093",
|
"datasourceUid": "PBFA97CFB590B2093",
|
||||||
"model": {
|
"model": {
|
||||||
"editorMode": "code",
|
"editorMode": "code",
|
||||||
"expr": "(node_filesystem_free_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"} / node_filesystem_size_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"}) * 100",
|
"expr": "(node_filesystem_free_bytes{fstype=\"ext4\"} / node_filesystem_size_bytes{fstype=\"ext4\"}) * 100",
|
||||||
"instant": true,
|
"instant": true,
|
||||||
"intervalMs": 1000,
|
"intervalMs": 1000,
|
||||||
"legendFormat": "__auto",
|
"legendFormat": "__auto",
|
||||||
|
|||||||
@ -93,7 +93,6 @@
|
|||||||
},
|
},
|
||||||
"hideTimeOverride": true,
|
"hideTimeOverride": true,
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
@ -107,10 +106,12 @@
|
|||||||
"fields": "",
|
"fields": "",
|
||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
|
"showPercentChange": false,
|
||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "auto"
|
"textMode": "auto",
|
||||||
|
"wideLayout": true
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -172,7 +173,6 @@
|
|||||||
"y": 0
|
"y": 0
|
||||||
},
|
},
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
@ -186,10 +186,12 @@
|
|||||||
"fields": "",
|
"fields": "",
|
||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
|
"showPercentChange": false,
|
||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "auto"
|
"textMode": "auto",
|
||||||
|
"wideLayout": true
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -251,7 +253,6 @@
|
|||||||
},
|
},
|
||||||
"hideTimeOverride": true,
|
"hideTimeOverride": true,
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
@ -265,10 +266,12 @@
|
|||||||
"fields": "",
|
"fields": "",
|
||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
|
"showPercentChange": false,
|
||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "auto"
|
"textMode": "auto",
|
||||||
|
"wideLayout": true
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -335,9 +338,10 @@
|
|||||||
"y": 0
|
"y": 0
|
||||||
},
|
},
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
|
"minVizHeight": 75,
|
||||||
|
"minVizWidth": 75,
|
||||||
"orientation": "horizontal",
|
"orientation": "horizontal",
|
||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
@ -348,9 +352,10 @@
|
|||||||
},
|
},
|
||||||
"showThresholdLabels": false,
|
"showThresholdLabels": false,
|
||||||
"showThresholdMarkers": true,
|
"showThresholdMarkers": true,
|
||||||
|
"sizing": "auto",
|
||||||
"text": {}
|
"text": {}
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -405,13 +410,12 @@
|
|||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 1,
|
"linewidth": 1,
|
||||||
"links": [],
|
|
||||||
"nullPointMode": "null",
|
"nullPointMode": "null",
|
||||||
"options": {
|
"options": {
|
||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
},
|
},
|
||||||
"percentage": false,
|
"percentage": false,
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"pointradius": 5,
|
"pointradius": 5,
|
||||||
"points": false,
|
"points": false,
|
||||||
"renderer": "flot",
|
"renderer": "flot",
|
||||||
@ -507,7 +511,6 @@
|
|||||||
},
|
},
|
||||||
"hideTimeOverride": true,
|
"hideTimeOverride": true,
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
@ -521,10 +524,12 @@
|
|||||||
"fields": "",
|
"fields": "",
|
||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
|
"showPercentChange": false,
|
||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "auto"
|
"textMode": "auto",
|
||||||
|
"wideLayout": true
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -585,7 +590,6 @@
|
|||||||
},
|
},
|
||||||
"hideTimeOverride": true,
|
"hideTimeOverride": true,
|
||||||
"id": 9,
|
"id": 9,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "value",
|
"colorMode": "value",
|
||||||
@ -599,10 +603,12 @@
|
|||||||
"fields": "",
|
"fields": "",
|
||||||
"values": false
|
"values": false
|
||||||
},
|
},
|
||||||
|
"showPercentChange": false,
|
||||||
"text": {},
|
"text": {},
|
||||||
"textMode": "auto"
|
"textMode": "auto",
|
||||||
|
"wideLayout": true
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -671,9 +677,10 @@
|
|||||||
},
|
},
|
||||||
"hideTimeOverride": true,
|
"hideTimeOverride": true,
|
||||||
"id": 11,
|
"id": 11,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
|
"minVizHeight": 75,
|
||||||
|
"minVizWidth": 75,
|
||||||
"orientation": "horizontal",
|
"orientation": "horizontal",
|
||||||
"reduceOptions": {
|
"reduceOptions": {
|
||||||
"calcs": [
|
"calcs": [
|
||||||
@ -684,9 +691,10 @@
|
|||||||
},
|
},
|
||||||
"showThresholdLabels": false,
|
"showThresholdLabels": false,
|
||||||
"showThresholdMarkers": true,
|
"showThresholdMarkers": true,
|
||||||
|
"sizing": "auto",
|
||||||
"text": {}
|
"text": {}
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
@ -713,7 +721,39 @@
|
|||||||
"fieldConfig": {
|
"fieldConfig": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"color": {
|
"color": {
|
||||||
"mode": "thresholds"
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"axisBorderShow": false,
|
||||||
|
"axisCenteredZero": false,
|
||||||
|
"axisColorMode": "text",
|
||||||
|
"axisLabel": "",
|
||||||
|
"axisPlacement": "left",
|
||||||
|
"barAlignment": 0,
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 0,
|
||||||
|
"gradientMode": "none",
|
||||||
|
"hideFrom": {
|
||||||
|
"legend": false,
|
||||||
|
"tooltip": false,
|
||||||
|
"viz": false
|
||||||
|
},
|
||||||
|
"insertNulls": false,
|
||||||
|
"lineInterpolation": "linear",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"pointSize": 5,
|
||||||
|
"scaleDistribution": {
|
||||||
|
"type": "linear"
|
||||||
|
},
|
||||||
|
"showPoints": "auto",
|
||||||
|
"spanNulls": false,
|
||||||
|
"stacking": {
|
||||||
|
"group": "A",
|
||||||
|
"mode": "none"
|
||||||
|
},
|
||||||
|
"thresholdsStyle": {
|
||||||
|
"mode": "off"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"mappings": [
|
"mappings": [
|
||||||
{
|
{
|
||||||
@ -747,33 +787,42 @@
|
|||||||
},
|
},
|
||||||
"unit": "percent"
|
"unit": "percent"
|
||||||
},
|
},
|
||||||
"overrides": []
|
"overrides": [
|
||||||
|
{
|
||||||
|
"matcher": {
|
||||||
|
"id": "byType",
|
||||||
|
"options": "time"
|
||||||
|
},
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"id": "custom.axisPlacement",
|
||||||
|
"value": "hidden"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 4,
|
"h": 6,
|
||||||
"w": 2.6666666666666665,
|
"w": 6,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 8
|
"y": 8
|
||||||
},
|
},
|
||||||
"id": 10,
|
"id": 10,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"maxPerRow": 12,
|
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "value",
|
"legend": {
|
||||||
"graphMode": "area",
|
"calcs": [],
|
||||||
"justifyMode": "auto",
|
"displayMode": "list",
|
||||||
"orientation": "horizontal",
|
"placement": "bottom",
|
||||||
"reduceOptions": {
|
"showLegend": true
|
||||||
"calcs": [
|
|
||||||
"last"
|
|
||||||
],
|
|
||||||
"fields": "",
|
|
||||||
"values": false
|
|
||||||
},
|
},
|
||||||
"textMode": "auto"
|
"tooltip": {
|
||||||
|
"mode": "single",
|
||||||
|
"sort": "none"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"repeat": "node_id",
|
"repeat": "node_id",
|
||||||
"repeatDirection": "h",
|
"repeatDirection": "h",
|
||||||
"targets": [
|
"targets": [
|
||||||
@ -782,18 +831,20 @@
|
|||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
"uid": "PBFA97CFB590B2093"
|
"uid": "PBFA97CFB590B2093"
|
||||||
},
|
},
|
||||||
|
"editorMode": "code",
|
||||||
"exemplar": true,
|
"exemplar": true,
|
||||||
"expr": "sum((node_filesystem_free_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"} / node_filesystem_size_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"}) * on(instance) group_left(node_name) node_meta{node_name=~\"$node_id\"} * 100) / count(node_meta * on(instance) group_left(node_name) node_meta{node_name=~\"$node_id\"})",
|
"expr": "node_filesystem_free_bytes{fstype=\"ext4\"} / node_filesystem_size_bytes{fstype=\"ext4\"} * on(instance) group_left(node_name) node_meta{node_name=~\"$node_id\"} * 100",
|
||||||
"format": "time_series",
|
"format": "time_series",
|
||||||
"interval": "",
|
"interval": "",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "",
|
"legendFormat": "{{mountpoint}}",
|
||||||
|
"range": true,
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"step": 20
|
"step": 20
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"title": "Available Disk Space $node_id",
|
"title": "Available Disk Space $node_id",
|
||||||
"type": "stat"
|
"type": "timeseries"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"aliasColors": {},
|
"aliasColors": {},
|
||||||
@ -811,7 +862,7 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 12
|
"y": 14
|
||||||
},
|
},
|
||||||
"hiddenSeries": false,
|
"hiddenSeries": false,
|
||||||
"id": 14,
|
"id": 14,
|
||||||
@ -830,13 +881,12 @@
|
|||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 1,
|
"linewidth": 1,
|
||||||
"links": [],
|
|
||||||
"nullPointMode": "null as zero",
|
"nullPointMode": "null as zero",
|
||||||
"options": {
|
"options": {
|
||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
},
|
},
|
||||||
"percentage": false,
|
"percentage": false,
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"pointradius": 5,
|
"pointradius": 5,
|
||||||
"points": false,
|
"points": false,
|
||||||
"renderer": "flot",
|
"renderer": "flot",
|
||||||
@ -900,6 +950,7 @@
|
|||||||
"mode": "palette-classic"
|
"mode": "palette-classic"
|
||||||
},
|
},
|
||||||
"custom": {
|
"custom": {
|
||||||
|
"axisBorderShow": false,
|
||||||
"axisCenteredZero": false,
|
"axisCenteredZero": false,
|
||||||
"axisColorMode": "text",
|
"axisColorMode": "text",
|
||||||
"axisLabel": "",
|
"axisLabel": "",
|
||||||
@ -913,6 +964,7 @@
|
|||||||
"tooltip": false,
|
"tooltip": false,
|
||||||
"viz": false
|
"viz": false
|
||||||
},
|
},
|
||||||
|
"insertNulls": false,
|
||||||
"lineInterpolation": "linear",
|
"lineInterpolation": "linear",
|
||||||
"lineWidth": 1,
|
"lineWidth": 1,
|
||||||
"pointSize": 5,
|
"pointSize": 5,
|
||||||
@ -961,12 +1013,11 @@
|
|||||||
},
|
},
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 2.6666666666666665,
|
"w": 6,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 19
|
"y": 21
|
||||||
},
|
},
|
||||||
"id": 15,
|
"id": 15,
|
||||||
"links": [],
|
|
||||||
"maxPerRow": 12,
|
"maxPerRow": 12,
|
||||||
"options": {
|
"options": {
|
||||||
"legend": {
|
"legend": {
|
||||||
@ -1074,7 +1125,7 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 26
|
"y": 28
|
||||||
},
|
},
|
||||||
"hiddenSeries": false,
|
"hiddenSeries": false,
|
||||||
"id": 16,
|
"id": 16,
|
||||||
@ -1091,13 +1142,12 @@
|
|||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 1,
|
"linewidth": 1,
|
||||||
"links": [],
|
|
||||||
"nullPointMode": "null as zero",
|
"nullPointMode": "null as zero",
|
||||||
"options": {
|
"options": {
|
||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
},
|
},
|
||||||
"percentage": false,
|
"percentage": false,
|
||||||
"pluginVersion": "10.0.2",
|
"pluginVersion": "10.4.14",
|
||||||
"pointradius": 5,
|
"pointradius": 5,
|
||||||
"points": false,
|
"points": false,
|
||||||
"renderer": "flot",
|
"renderer": "flot",
|
||||||
@ -1178,7 +1228,7 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 12,
|
"w": 12,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 33
|
"y": 35
|
||||||
},
|
},
|
||||||
"hiddenSeries": false,
|
"hiddenSeries": false,
|
||||||
"id": 18,
|
"id": 18,
|
||||||
@ -1195,7 +1245,6 @@
|
|||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 1,
|
"linewidth": 1,
|
||||||
"links": [],
|
|
||||||
"nullPointMode": "null as zero",
|
"nullPointMode": "null as zero",
|
||||||
"options": {
|
"options": {
|
||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
@ -1281,7 +1330,7 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 12,
|
"w": 12,
|
||||||
"x": 12,
|
"x": 12,
|
||||||
"y": 33
|
"y": 35
|
||||||
},
|
},
|
||||||
"hiddenSeries": false,
|
"hiddenSeries": false,
|
||||||
"id": 19,
|
"id": 19,
|
||||||
@ -1300,7 +1349,6 @@
|
|||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 1,
|
"linewidth": 1,
|
||||||
"links": [],
|
|
||||||
"nullPointMode": "null as zero",
|
"nullPointMode": "null as zero",
|
||||||
"options": {
|
"options": {
|
||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
@ -1376,7 +1424,7 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 18,
|
"w": 18,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 40
|
"y": 42
|
||||||
},
|
},
|
||||||
"hiddenSeries": false,
|
"hiddenSeries": false,
|
||||||
"id": 12,
|
"id": 12,
|
||||||
@ -1397,7 +1445,6 @@
|
|||||||
},
|
},
|
||||||
"lines": true,
|
"lines": true,
|
||||||
"linewidth": 1,
|
"linewidth": 1,
|
||||||
"links": [],
|
|
||||||
"nullPointMode": "null",
|
"nullPointMode": "null",
|
||||||
"options": {
|
"options": {
|
||||||
"alertThreshold": true
|
"alertThreshold": true
|
||||||
@ -1499,10 +1546,9 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 6,
|
"w": 6,
|
||||||
"x": 18,
|
"x": 18,
|
||||||
"y": 40
|
"y": 42
|
||||||
},
|
},
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"links": [],
|
|
||||||
"maxDataPoints": 100,
|
"maxDataPoints": 100,
|
||||||
"options": {
|
"options": {
|
||||||
"colorMode": "none",
|
"colorMode": "none",
|
||||||
@ -1600,10 +1646,9 @@
|
|||||||
"h": 7,
|
"h": 7,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 47
|
"y": 49
|
||||||
},
|
},
|
||||||
"id": 17,
|
"id": 17,
|
||||||
"links": [],
|
|
||||||
"options": {
|
"options": {
|
||||||
"legend": {
|
"legend": {
|
||||||
"calcs": [],
|
"calcs": [],
|
||||||
@ -1658,7 +1703,7 @@
|
|||||||
"h": 9,
|
"h": 9,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 54
|
"y": 56
|
||||||
},
|
},
|
||||||
"id": 30,
|
"id": 30,
|
||||||
"options": {
|
"options": {
|
||||||
@ -1688,8 +1733,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"refresh": "",
|
"refresh": "",
|
||||||
"schemaVersion": 38,
|
"schemaVersion": 39,
|
||||||
"style": "dark",
|
|
||||||
"tags": [
|
"tags": [
|
||||||
"swarmprom",
|
"swarmprom",
|
||||||
"prometheus",
|
"prometheus",
|
||||||
@ -1836,6 +1880,6 @@
|
|||||||
"timezone": "",
|
"timezone": "",
|
||||||
"title": "Docker Swarm Nodes",
|
"title": "Docker Swarm Nodes",
|
||||||
"uid": "BPlb-Sgik",
|
"uid": "BPlb-Sgik",
|
||||||
"version": 24,
|
"version": 7,
|
||||||
"weekStart": ""
|
"weekStart": ""
|
||||||
}
|
}
|
||||||
@ -21,7 +21,7 @@ tls_skip_verify_insecure = false
|
|||||||
allow_sign_up = true
|
allow_sign_up = true
|
||||||
auto_login = true
|
auto_login = true
|
||||||
client_id = {{ env "OIDC_CLIENT_ID" }}
|
client_id = {{ env "OIDC_CLIENT_ID" }}
|
||||||
client_secret = {{ secret "grafana_oidc_client_secret" }}
|
client_secret = {{ secret "gf_oidc_secret" }}
|
||||||
auth_url = {{ env "OIDC_AUTH_URL" }}
|
auth_url = {{ env "OIDC_AUTH_URL" }}
|
||||||
token_url = {{ env "OIDC_TOKEN_URL" }}
|
token_url = {{ env "OIDC_TOKEN_URL" }}
|
||||||
api_url = {{ env "OIDC_API_URL" }}
|
api_url = {{ env "OIDC_API_URL" }}
|
||||||
|
|||||||
@ -34,7 +34,6 @@ ingester:
|
|||||||
max_chunk_age: 1h # All chunks will be flushed when they hit this age, default is 1h
|
max_chunk_age: 1h # All chunks will be flushed when they hit this age, default is 1h
|
||||||
chunk_target_size: 1048576 # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
|
chunk_target_size: 1048576 # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
|
||||||
chunk_retain_period: 30s # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
|
chunk_retain_period: 30s # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
|
||||||
max_transfer_retries: 0 # Chunk transfers disabled
|
|
||||||
wal:
|
wal:
|
||||||
dir: "/tmp/wal"
|
dir: "/tmp/wal"
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ schema_config:
|
|||||||
- from: 2020-10-24
|
- from: 2020-10-24
|
||||||
store: boltdb-shipper
|
store: boltdb-shipper
|
||||||
object_store: filesystem
|
object_store: filesystem
|
||||||
schema: v11
|
schema: v13
|
||||||
index:
|
index:
|
||||||
prefix: index_
|
prefix: index_
|
||||||
period: 24h
|
period: 24h
|
||||||
@ -63,7 +62,6 @@ storage_config:
|
|||||||
active_index_directory: /loki/boltdb-shipper-active
|
active_index_directory: /loki/boltdb-shipper-active
|
||||||
cache_location: /loki/boltdb-shipper-cache
|
cache_location: /loki/boltdb-shipper-cache
|
||||||
cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
|
cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
|
||||||
shared_store: filesystem
|
|
||||||
filesystem:
|
filesystem:
|
||||||
directory: /loki/chunks
|
directory: /loki/chunks
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -72,7 +70,6 @@ schema_config:
|
|||||||
configs:
|
configs:
|
||||||
- from: 2020-11-25
|
- from: 2020-11-25
|
||||||
store: boltdb-shipper
|
store: boltdb-shipper
|
||||||
object_store: aws
|
|
||||||
schema: v11
|
schema: v11
|
||||||
index:
|
index:
|
||||||
prefix: index_
|
prefix: index_
|
||||||
@ -89,7 +86,7 @@ storage_config:
|
|||||||
endpoint: {{ env "LOKI_AWS_ENDPOINT" }}
|
endpoint: {{ env "LOKI_AWS_ENDPOINT" }}
|
||||||
region: {{ env "LOKI_AWS_REGION" }}
|
region: {{ env "LOKI_AWS_REGION" }}
|
||||||
access_key_id: {{ env "LOKI_ACCESS_KEY_ID" }}
|
access_key_id: {{ env "LOKI_ACCESS_KEY_ID" }}
|
||||||
secret_access_key: {{ secret "loki_aws_secret_access_key" }}
|
secret_access_key: {{ secret "loki_aws_key" }}
|
||||||
bucketnames: {{ env "LOKI_BUCKET_NAMES" }}
|
bucketnames: {{ env "LOKI_BUCKET_NAMES" }}
|
||||||
insecure: false
|
insecure: false
|
||||||
sse_encryption: false
|
sse_encryption: false
|
||||||
@ -103,19 +100,24 @@ storage_config:
|
|||||||
|
|
||||||
compactor:
|
compactor:
|
||||||
working_directory: /loki/boltdb-shipper-compactor
|
working_directory: /loki/boltdb-shipper-compactor
|
||||||
shared_store: filesystem
|
|
||||||
compaction_interval: 10m
|
compaction_interval: 10m
|
||||||
retention_enabled: true
|
retention_enabled: true
|
||||||
retention_delete_delay: 2h
|
retention_delete_delay: 2h
|
||||||
retention_delete_worker_count: 150
|
retention_delete_worker_count: 150
|
||||||
|
{{ if eq (env "LOKI_STORAGE_FILESYSTEM") "1" }}
|
||||||
|
delete_request_store: filesystem
|
||||||
|
{{ end }}
|
||||||
|
{{ if eq (env "LOKI_STORAGE_S3") "1" }}
|
||||||
|
delete_request_store: aws
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
limits_config:
|
limits_config:
|
||||||
enforce_metric_name: false
|
|
||||||
reject_old_samples: true
|
reject_old_samples: true
|
||||||
reject_old_samples_max_age: 168h
|
reject_old_samples_max_age: 168h
|
||||||
retention_period: {{ env "LOKI_RETENTION_PERIOD" }}
|
retention_period: {{ env "LOKI_RETENTION_PERIOD" }}
|
||||||
split_queries_by_interval: 24h
|
split_queries_by_interval: 24h
|
||||||
max_query_parallelism: 100
|
max_query_parallelism: 100
|
||||||
|
allow_structured_metadata: false
|
||||||
|
|
||||||
query_scheduler:
|
query_scheduler:
|
||||||
max_outstanding_requests_per_tenant: 4096
|
max_outstanding_requests_per_tenant: 4096
|
||||||
@ -123,9 +125,6 @@ query_scheduler:
|
|||||||
frontend:
|
frontend:
|
||||||
max_outstanding_per_tenant: 4096
|
max_outstanding_per_tenant: 4096
|
||||||
|
|
||||||
chunk_store_config:
|
|
||||||
max_look_back_period: 0s
|
|
||||||
|
|
||||||
table_manager:
|
table_manager:
|
||||||
retention_deletes_enabled: false
|
retention_deletes_enabled: false
|
||||||
retention_period: 0s
|
retention_period: 0s
|
||||||
@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
NODE_NAME=$(cat /etc/nodename)
|
|
||||||
|
|
||||||
mkdir -p /etc/node-exporter
|
|
||||||
|
|
||||||
echo "node_meta{node_id=\"$NODE_ID\", container_label_com_docker_swarm_node_id=\"$NODE_ID\", node_name=\"$NODE_NAME\"} 1" > /etc/node-exporter/node-meta.prom
|
|
||||||
|
|
||||||
set -- /bin/node_exporter "$@"
|
|
||||||
|
|
||||||
exec "$@"
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
server:
|
|
||||||
http_listen_port: 9080
|
|
||||||
grpc_listen_port: 0
|
|
||||||
|
|
||||||
positions:
|
|
||||||
filename: /tmp/positions.yaml
|
|
||||||
|
|
||||||
clients:
|
|
||||||
- url: {{ env "LOKI_PUSH_URL" }}
|
|
||||||
basic_auth:
|
|
||||||
username: admin
|
|
||||||
password: {{ secret "basic_auth" }}
|
|
||||||
external_labels:
|
|
||||||
hostname: {{ env "DOMAIN" }}
|
|
||||||
|
|
||||||
scrape_configs:
|
|
||||||
- job_name: system
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- localhost
|
|
||||||
labels:
|
|
||||||
job: varlogs
|
|
||||||
__path__: /var/log/*log
|
|
||||||
|
|
||||||
- job_name: "docker"
|
|
||||||
docker_sd_configs:
|
|
||||||
- host: "unix:///var/run/docker.sock"
|
|
||||||
refresh_interval: "10s"
|
|
||||||
relabel_configs:
|
|
||||||
- source_labels: ['__meta_docker_container_name']
|
|
||||||
target_label: "container_name"
|
|
||||||
- source_labels: ['__meta_docker_container_id']
|
|
||||||
target_label: "container_id"
|
|
||||||
- source_labels: ['__meta_docker_container_label_com_docker_stack_namespace']
|
|
||||||
target_label: "stack_namespace"
|
|
||||||
- source_labels: ['__meta_docker_container_label_com_docker_swarm_service_name']
|
|
||||||
target_label: "service_name"
|
|
||||||
12
release/next
Normal file
12
release/next
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
1. OIDC was moved into a seperate compose file. If you have oidc configured you need to add the following line to you .env file:
|
||||||
|
|
||||||
|
COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-oidc.yml"
|
||||||
|
|
||||||
|
2. SMTP was moved into a seperate compose file. If you have smtp configured you need to add the following line to you .env file:
|
||||||
|
|
||||||
|
COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-smtp.yml"
|
||||||
|
|
||||||
|
3. The scrape-config.example.yml file and add_node() command were updated to use a secure endpoint for the traefik metrics instead of http. This requires an updated Traefik recipe that publishes the metrics on https.
|
||||||
|
|
||||||
|
4. Secret and config names were shortened to max 14 characters to prevent going over Docker's 64 character limit when STACK_NAME and VERSION are added to it.
|
||||||
|
When upgrading, you need to reinsert the secrets with their shorter names. Run `abra app secret list <domain>` to see which secrets aren't created on the server (because their name was shortened) and run `abra app secret insert <domain> <secret_name> v1 <value>` to reinsert them with the shorter name. Or you can use the migrate_secret_names function in abra.sh to reinsert all existing secrets with their shorter name automatically: `abra app cmd --local <domain> migrate_secret_names`
|
||||||
@ -1,4 +1,4 @@
|
|||||||
- targets:
|
- targets:
|
||||||
- 'example.org:8082'
|
- 'metrics.traefik.example.org'
|
||||||
- 'node.monitoring.example.org'
|
- 'node.monitoring.example.org'
|
||||||
- 'cadvisor.monitoring.example.org'
|
- 'cadvisor.monitoring.example.org'
|
||||||
|
|||||||
Reference in New Issue
Block a user