Updates for grafana stack

This commit is contained in:
2026-07-10 06:50:52 -05:00
parent 728a0c60f2
commit f37ec41530
16 changed files with 652 additions and 97 deletions
@@ -0,0 +1,60 @@
# Managed by Ansible (roles/observability). Do not edit by hand.
services:
loki:
image: {{ observability_loki_image }}
container_name: loki
restart: unless-stopped
user: "0:0"
command: -config.file=/etc/loki/loki-config.yml
ports:
- "3100:3100"
volumes:
- ./loki/loki-config.yml:/etc/loki/loki-config.yml:ro
- ./loki/data:/loki
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3100/ready || exit 1"]
interval: 15s
timeout: 5s
retries: 10
prometheus:
image: {{ observability_prometheus_image }}
container_name: prometheus
restart: unless-stopped
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time={{ observability_prometheus_retention }}
- --web.enable-remote-write-receiver
- --web.enable-lifecycle
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- ./prometheus/data:/prometheus
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:9090/-/ready || exit 1"]
interval: 15s
timeout: 5s
retries: 10
grafana:
image: {{ observability_grafana_image }}
container_name: grafana
restart: unless-stopped
depends_on:
loki:
condition: service_healthy
prometheus:
condition: service_healthy
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_USER: "{{ observability_grafana_admin_user }}"
GF_SECURITY_ADMIN_PASSWORD: "{{ observability_grafana_admin_password }}"
GF_USERS_ALLOW_SIGN_UP: "false"
GF_SERVER_ROOT_URL: "{{ observability_grafana_public_url }}"
GF_SERVER_DOMAIN: "{{ observability_grafana_domain }}"
volumes:
- ./grafana/data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning:ro
@@ -0,0 +1,21 @@
# Managed by Ansible (roles/observability). Do not edit by hand.
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
url: http://loki:3100
isDefault: false
editable: false
jsonData:
maxLines: 1000
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
jsonData:
timeInterval: 15s
@@ -0,0 +1,47 @@
# Managed by Ansible (roles/observability). Do not edit by hand.
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: info
common:
instance_addr: 127.0.0.1
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: "2024-01-01"
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
limits_config:
reject_old_samples: true
reject_old_samples_max_age: 168h
ingestion_rate_mb: 16
ingestion_burst_size_mb: 32
max_query_series: 500
retention_period: {{ observability_loki_retention }}
compactor:
working_directory: /loki/compactor
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
delete_request_store: filesystem
ruler:
alertmanager_url: http://localhost:9093
@@ -0,0 +1,13 @@
# Managed by Ansible (roles/observability). Do not edit by hand.
global:
scrape_interval: 15s
evaluation_interval: 15s
# Alloy on each host pushes metrics via remote_write.
# Local scrape keeps Prometheus self-health visible.
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
labels:
host: "{{ inventory_hostname }}"