From c56f9727afd6da47ca8acdf3669e8f698badfb25 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 20:48:45 +0200 Subject: [PATCH 01/46] loki --- docker-compose/loki/docker-compose.yml.j2 | 23 +++++++++ docker-compose/loki/loki-config.yml.j2 | 57 +++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 docker-compose/loki/docker-compose.yml.j2 create mode 100644 docker-compose/loki/loki-config.yml.j2 diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 new file mode 100644 index 00000000..d682bf73 --- /dev/null +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -0,0 +1,23 @@ +# https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/prometheus_grafana_loki#Loki +services: + loki: + image: grafana/loki:v3.2.0 + container_name: loki + restart: always + volumes: + - data:/loki + - ./loki-config.yml:/etc/loki-config.yml + command: + - '-config.file=/etc/loki-config.yml' + ports: + - "3100:3100" +# labels: +# org.label-schema.group: "monitoring" + +######## Networks ######## +networks: + loki: + +######## Volumes ######## +volumes: + data: diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 new file mode 100644 index 00000000..a97bc8cd --- /dev/null +++ b/docker-compose/loki/loki-config.yml.j2 @@ -0,0 +1,57 @@ +# https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/prometheus_grafana_loki#Loki + +auth_enabled: false + +server: + http_listen_port: 3100 + +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 + +# --- disable splitting to fix "too many outstanding requests" + +query_range: + parallelise_shardable_queries: false + +# --- compactor to have control over length of data retention + +compactor: + working_directory: /loki/compactor + compaction_interval: 10m + retention_enabled: true + retention_delete_delay: 2h + retention_delete_worker_count: 150 + +limits_config: + retention_period: 240h + split_queries_by_interval: 0 # part of disable splitting fix + +# ------------------------------------------------------- + +schema_config: + configs: + - from: 2020-10-24 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +# ruler: +# alertmanager_url: http://alertmanager:9093 + +analytics: + reporting_enabled: false + + +# TODO alertmanager -- 2.43.0 From 9187507052af363fda98b8a7adb428f326c1f3e0 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 20:51:09 +0200 Subject: [PATCH 02/46] todo --- docker-compose/loki/loki-config.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index a97bc8cd..8e5084b5 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -55,3 +55,4 @@ analytics: # TODO alertmanager +# promtail -- 2.43.0 From 4813ba04a53191bc3d0c3d6642ba4a34b250e57d Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 20:51:13 +0200 Subject: [PATCH 03/46] role --- playbooks/base/monitoring.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/playbooks/base/monitoring.yml b/playbooks/base/monitoring.yml index f92b6b1f..1f155cf5 100644 --- a/playbooks/base/monitoring.yml +++ b/playbooks/base/monitoring.yml @@ -4,8 +4,6 @@ - role: mgrote_munin_node become: true tags: "munin" - when: "not 'laptop' in group_names" - - ### Die Host müssen auch beim Docker-Container: "munin-master eingetragen" werden. - ### wird nur auf physischen Rechnern ausgeführt. - ### Wenn ein Plugin nicht geht: munin-node-configure --shell --families=contrib,auto | sh -x + - role: patrickjahns.promtail + become: true + tags: "promtail" -- 2.43.0 From 59306f9a5bb0287e78881d6a361245d18e96bc45 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 20:53:00 +0200 Subject: [PATCH 04/46] ff --- group_vars/all.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/group_vars/all.yml b/group_vars/all.yml index 8e05f536..c25d6ef7 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -11,6 +11,10 @@ file_header: | ansible_forgejo_user: svc_ansible ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forgejo_user_pass', 'password') }}" # user ist dem Repo als "Collaborator" + "RO" hinzugefügt worden +### patrickjahns.promtail +promtail_version: "3.0.0" # TODO renovate +promtail_loki_server_url: "docker10.mgrote.net:3100" + ### mgrote_user_setup dotfiles: - user: mg -- 2.43.0 From a367667c3a3238c2b301369138333131f7a5d1e9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 20:54:09 +0200 Subject: [PATCH 05/46] ss --- group_vars/all.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/group_vars/all.yml b/group_vars/all.yml index c25d6ef7..46cabbf2 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -14,6 +14,15 @@ ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forg ### patrickjahns.promtail promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "docker10.mgrote.net:3100" +promtail_config_scrape_configs: + - job_name: system + static_configs: + - targets: + - localhost + labels: + job: varlogs + __path__: /var/log/* + # TODO add docker ### mgrote_user_setup dotfiles: -- 2.43.0 From 83bfefd494bf381884a8306ce67918dfc6200b70 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 20:59:25 +0200 Subject: [PATCH 06/46] fff --- docker-compose/loki/docker-compose.yml.j2 | 25 ++++++++++++++++++++--- docker-compose/loki/grafana.env.j2 | 13 ++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 docker-compose/loki/grafana.env.j2 diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index d682bf73..8e575559 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -5,19 +5,38 @@ services: container_name: loki restart: always volumes: - - data:/loki + - loki:/loki - ./loki-config.yml:/etc/loki-config.yml command: - '-config.file=/etc/loki-config.yml' ports: - "3100:3100" + networks: + - internal +# labels: +# org.label-schema.group: "monitoring" + + grafana: + image: grafana/grafana:9.4.3 + container_name: grafana + restart: always + env_file: .env + volumes: + - grafana:/var/lib/grafana + expose: + - "3101" + networks: + - internal # labels: # org.label-schema.group: "monitoring" ######## Networks ######## networks: - loki: + postfix: + external: true + internal: ######## Volumes ######## volumes: - data: + loki: + grafana: diff --git a/docker-compose/loki/grafana.env.j2 b/docker-compose/loki/grafana.env.j2 new file mode 100644 index 00000000..b4a2fb3f --- /dev/null +++ b/docker-compose/loki/grafana.env.j2 @@ -0,0 +1,13 @@ +# GENERAL +TZ=Europe/Berlin + +# GRAFANA +GF_SECURITY_ADMIN_USER=admin # TODO +GF_SECURITY_ADMIN_PASSWORD=admin # TODO +GF_USERS_ALLOW_SIGN_UP=false + +# GRAFANA EMAIL +GF_SMTP_ENABLED=true +GF_SMTP_HOST=postfix +GF_SMTP_USER=grafana@mgrote.net +GF_SMTP_PASSWORD="" -- 2.43.0 From e0a12ad60bad502616e2cb1121d6900a0671b28c Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:00:20 +0200 Subject: [PATCH 07/46] dd --- host_vars/docker10.mgrote.net.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/host_vars/docker10.mgrote.net.yml b/host_vars/docker10.mgrote.net.yml index 0574b358..eacf19fd 100644 --- a/host_vars/docker10.mgrote.net.yml +++ b/host_vars/docker10.mgrote.net.yml @@ -66,6 +66,9 @@ compose_files: state: present - name: act-runner state: present + - name: loki + state: present + network: postfix ### oefenweb.ufw ufw_rules: -- 2.43.0 From 94d08ed7ae5ad2a69d5f2972c9fc95b05cbab243 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:02:45 +0200 Subject: [PATCH 08/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 8e575559..20c169d1 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -20,7 +20,7 @@ services: image: grafana/grafana:9.4.3 container_name: grafana restart: always - env_file: .env + env_file: grafana.env volumes: - grafana:/var/lib/grafana expose: -- 2.43.0 From 3b7fa9b9b2158a9adfbf7ea5aef76c33b5987552 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:04:06 +0200 Subject: [PATCH 09/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 20c169d1..dea4d34c 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -1,7 +1,7 @@ # https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/prometheus_grafana_loki#Loki services: loki: - image: grafana/loki:v3.2.0 + image: grafana/loki:3.2.0 container_name: loki restart: always volumes: -- 2.43.0 From 924afa93bc9348e2759e23fd36e02c19d2b6cba2 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:06:29 +0200 Subject: [PATCH 10/46] ff --- docker-compose/loki/loki-config.yml.j2 | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index 8e5084b5..dc5cd4a6 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -17,26 +17,6 @@ common: kvstore: store: inmemory -# --- disable splitting to fix "too many outstanding requests" - -query_range: - parallelise_shardable_queries: false - -# --- compactor to have control over length of data retention - -compactor: - working_directory: /loki/compactor - compaction_interval: 10m - retention_enabled: true - retention_delete_delay: 2h - retention_delete_worker_count: 150 - -limits_config: - retention_period: 240h - split_queries_by_interval: 0 # part of disable splitting fix - -# ------------------------------------------------------- - schema_config: configs: - from: 2020-10-24 @@ -47,12 +27,10 @@ schema_config: prefix: index_ period: 24h -# ruler: -# alertmanager_url: http://alertmanager:9093 - analytics: reporting_enabled: false # TODO alertmanager -# promtail +# TODO promtail +# TODO prometheus -- 2.43.0 From 9c7d7c6ea038c6112ca2543afe4cd2bdd1e6be00 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:08:23 +0200 Subject: [PATCH 11/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index dea4d34c..b9157eca 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -23,8 +23,8 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana - expose: - - "3101" + ports: + - "3101:3000" networks: - internal # labels: -- 2.43.0 From 36f8b031fdcff8f8d762fe975ed32a7e397707fb Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:09:42 +0200 Subject: [PATCH 12/46] ff --- docker-compose/loki/docker-compose.yml.j2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index b9157eca..abbe7f7c 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -13,8 +13,6 @@ services: - "3100:3100" networks: - internal -# labels: -# org.label-schema.group: "monitoring" grafana: image: grafana/grafana:9.4.3 @@ -27,8 +25,6 @@ services: - "3101:3000" networks: - internal -# labels: -# org.label-schema.group: "monitoring" ######## Networks ######## networks: -- 2.43.0 From 2d6b53bc06de5ab7cf1e325049006e5cb0c03158 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:17:36 +0200 Subject: [PATCH 13/46] fw --- group_vars/all.yml | 5 +++++ group_vars/blocky.yml | 5 +++++ group_vars/docker.yml | 5 +++++ group_vars/fileserver.yml | 5 +++++ group_vars/git.yml | 5 +++++ group_vars/ldap.yml | 5 +++++ group_vars/munin.yml | 8 ++++++-- 7 files changed, 36 insertions(+), 2 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 46cabbf2..6d8c2b3e 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -96,6 +96,11 @@ ufw_rules: protocol: tcp comment: 'munin' from_ip: 192.168.2.0/24 + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 ufw_default_incoming_policy: deny ufw_default_outgoing_policy: allow diff --git a/group_vars/blocky.yml b/group_vars/blocky.yml index f667a14c..370c2e29 100644 --- a/group_vars/blocky.yml +++ b/group_vars/blocky.yml @@ -14,6 +14,11 @@ ufw_rules: protocol: tcp comment: 'munin' from_ip: 192.168.2.0/24 + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 - rule: allow to_port: 53 comment: 'dns' diff --git a/group_vars/docker.yml b/group_vars/docker.yml index b0ebe4e6..f539bf71 100644 --- a/group_vars/docker.yml +++ b/group_vars/docker.yml @@ -140,6 +140,11 @@ ufw_rules: protocol: tcp comment: 'munin' from_ip: 192.168.2.0/24 + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 - rule: allow from_ip: 192.168.0.0/16 comment: 'docker networks' diff --git a/group_vars/fileserver.yml b/group_vars/fileserver.yml index 94df5466..bb7eeb96 100644 --- a/group_vars/fileserver.yml +++ b/group_vars/fileserver.yml @@ -14,6 +14,11 @@ ufw_rules: protocol: tcp comment: 'munin' from_ip: 192.168.2.0/24 + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 - rule: allow to_port: 445 comment: 'smb' diff --git a/group_vars/git.yml b/group_vars/git.yml index c665b37b..03f82bc6 100644 --- a/group_vars/git.yml +++ b/group_vars/git.yml @@ -41,6 +41,11 @@ ufw_rules: protocol: tcp comment: 'munin' from_ip: 192.168.2.0/24 + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 - rule: allow to_port: "{{ gitea_http_port }}" protocol: tcp diff --git a/group_vars/ldap.yml b/group_vars/ldap.yml index 846c9e82..e918cfd2 100644 --- a/group_vars/ldap.yml +++ b/group_vars/ldap.yml @@ -18,6 +18,11 @@ ufw_rules: protocol: tcp comment: 'munin' from_ip: 192.168.2.0/24 + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 - rule: allow to_port: "{{ lldap_http_port }}" protocol: tcp diff --git a/group_vars/munin.yml b/group_vars/munin.yml index 6fbfc29d..7a8aabd1 100644 --- a/group_vars/munin.yml +++ b/group_vars/munin.yml @@ -7,10 +7,14 @@ ufw_rules: comment: 'ssh' from_ip: 0.0.0.0/0 - rule: allow - to_port: 80 #TODO passt? + to_port: 80 protocol: tcp comment: 'munin' - + - rule: allow + to_port: 9080 + protocol: tcp + comment: 'promtail' + from_ip: 192.168.2.0/24 ### mgrote_restic restic_folders_to_backup: "/usr/local /etc /root /home /var/lib/munin" -- 2.43.0 From bb3f8d0c0416641d834cace627c9a54c145626bf Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:24:24 +0200 Subject: [PATCH 14/46] ss --- docker-compose/loki/docker-compose.yml.j2 | 4 ++++ group_vars/all.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index abbe7f7c..eca67e51 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -36,3 +36,7 @@ networks: volumes: loki: grafana: + + +# TODO: http://vm-test-2204.mgrote.net:9080/targets + wenn firewall aus +# grafana dashboard und datasource als code? diff --git a/group_vars/all.yml b/group_vars/all.yml index 6d8c2b3e..c6c96661 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -13,7 +13,7 @@ ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forg ### patrickjahns.promtail promtail_version: "3.0.0" # TODO renovate -promtail_loki_server_url: "docker10.mgrote.net:3100" +promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? promtail_config_scrape_configs: - job_name: system static_configs: -- 2.43.0 From 4019ec8ff4b19c72ee6a075e03e7c5fb77535fd6 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:29:52 +0200 Subject: [PATCH 15/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 5 +++-- docker-compose/loki/loki-config.yml.j2 | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index eca67e51..15c94d9d 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -1,4 +1,5 @@ -# https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/prometheus_grafana_loki#Loki +# https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/prometheus_grafana_loki +# https://ghazanfaralidevops.medium.com/grafana-loki-promtail-complete-end-to-end-project-d698aaa636d6 services: loki: image: grafana/loki:3.2.0 @@ -39,4 +40,4 @@ volumes: # TODO: http://vm-test-2204.mgrote.net:9080/targets + wenn firewall aus -# grafana dashboard und datasource als code? +# TODO: grafana dashboard und datasource als code? + https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index dc5cd4a6..162186db 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -1,5 +1,3 @@ -# https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/prometheus_grafana_loki#Loki - auth_enabled: false server: -- 2.43.0 From c979bc110828b6f6e33acccc46ff9048adadbc3c Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:36:26 +0200 Subject: [PATCH 16/46] dd --- docker-compose/loki/datasources.j2 | 31 +++++++++++++++++++++++ docker-compose/loki/docker-compose.yml.j2 | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 docker-compose/loki/datasources.j2 diff --git a/docker-compose/loki/datasources.j2 b/docker-compose/loki/datasources.j2 new file mode 100644 index 00000000..c6854173 --- /dev/null +++ b/docker-compose/loki/datasources.j2 @@ -0,0 +1,31 @@ +# Configuration file version +apiVersion: 1 + +# Mark provisioned data sources for deletion if they are no longer in a provisioning file. +# It takes no effect if data sources are already listed in the deleteDatasources section. +prune: true + +# List of data sources to insert/update depending on what's +# available in the database. +datasources: + # Sets the name you use to refer to + # the data source in panels and queries. + - name: Loki + # Sets the data source type. + type: loki + # Sets the access mode, either + # proxy or direct (Server or Browser in the UI). + # Some data sources are incompatible with any setting + # but proxy (Server). + access: direct + # Sets the organization id. Defaults to orgId 1. + orgId: 1 + # Sets the data source's URL, including the + # port. + url: http://loki:3100 + # Sets the version. Used to compare versions when + # updating. Ignored when creating a new data source. + version: 1 + # Allows users to edit data sources from the + # Grafana UI. + editable: false diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 15c94d9d..7d9fff63 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,6 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana + - datasources.j2:/etc/grafana/provisioning/dashboards ports: - "3101:3000" networks: @@ -41,3 +42,4 @@ volumes: # TODO: http://vm-test-2204.mgrote.net:9080/targets + wenn firewall aus # TODO: grafana dashboard und datasource als code? + https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources +# TODO: URLS: http://docker10.mgrote.net:3101/explore?orgId=1&left=%7B%22datasource%22:%22U4h5CxgHz%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22U4h5CxgHz%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D + http://docker10.mgrote.net:3100/ready + http://vm-test-2204.mgrote.net:9080/config -- 2.43.0 From 66dfc2652257ecdeb003bc8487b581c2eedb6070 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:37:33 +0200 Subject: [PATCH 17/46] dd --- group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index c6c96661..06062aae 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -21,7 +21,7 @@ promtail_config_scrape_configs: - localhost labels: job: varlogs - __path__: /var/log/* + __path__: /var/log/**/** # TODO add docker ### mgrote_user_setup -- 2.43.0 From 3d19aaa9621f05d80389fadb045472769a5fbf10 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:39:18 +0200 Subject: [PATCH 18/46] dd --- group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 06062aae..933a2a86 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -9,7 +9,7 @@ file_header: | #----------------------------------------------------------------# # für Zugriff auf nicht öffentliche git.mgrote.net-Repos ansible_forgejo_user: svc_ansible -ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forgejo_user_pass', 'password') }}" # user ist dem Repo als "Collaborator" + "RO" hinzugefügt worden +ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forgejo_user_pass', 'password') }}" # User ist dem Repo als "Collaborator" + "RO" hinzugefügt worden ### patrickjahns.promtail promtail_version: "3.0.0" # TODO renovate -- 2.43.0 From c76caf0a9e76ffe23e9550f56fffa9ed5f500db8 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:41:38 +0200 Subject: [PATCH 19/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 1 + group_vars/all.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 7d9fff63..4c6f43cd 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -43,3 +43,4 @@ volumes: # TODO: http://vm-test-2204.mgrote.net:9080/targets + wenn firewall aus # TODO: grafana dashboard und datasource als code? + https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources # TODO: URLS: http://docker10.mgrote.net:3101/explore?orgId=1&left=%7B%22datasource%22:%22U4h5CxgHz%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22U4h5CxgHz%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D + http://docker10.mgrote.net:3100/ready + http://vm-test-2204.mgrote.net:9080/config +# TODO: grafana an LDAP: https://github.com/lldap/lldap/blob/main/example_configs/grafana_ldap_config.toml diff --git a/group_vars/all.yml b/group_vars/all.yml index 933a2a86..97d19070 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -14,6 +14,7 @@ ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forg ### patrickjahns.promtail promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? +promtail_user_additional_groups: root promtail_config_scrape_configs: - job_name: system static_configs: -- 2.43.0 From eea63f64d489855c844bb434c40bda69fde9d7fd Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:49:30 +0200 Subject: [PATCH 20/46] ff --- group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 97d19070..df8f85e5 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -23,7 +23,7 @@ promtail_config_scrape_configs: labels: job: varlogs __path__: /var/log/**/** - # TODO add docker +# TODO add docker ### mgrote_user_setup dotfiles: -- 2.43.0 From 0cac94527be3aa1773e5e63906f13ea422e5a1f6 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:49:44 +0200 Subject: [PATCH 21/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 4c6f43cd..013a64b7 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,7 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana - - datasources.j2:/etc/grafana/provisioning/dashboards + - datasources:/etc/grafana/provisioning/dashboards ports: - "3101:3000" networks: -- 2.43.0 From 1204bc9ce71ec90d7fc2ab057c410c072cd1e39b Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:50:23 +0200 Subject: [PATCH 22/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 013a64b7..a42101ec 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,7 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana - - datasources:/etc/grafana/provisioning/dashboards + - ./datasources:/etc/grafana/provisioning/dashboards ports: - "3101:3000" networks: -- 2.43.0 From 25c4e4c90ca855e5b248a28f191542305a10ea6d Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:52:03 +0200 Subject: [PATCH 23/46] ff --- docker-compose/loki/{datasources.j2 => datasources.yaml.j2} | 0 docker-compose/loki/docker-compose.yml.j2 | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename docker-compose/loki/{datasources.j2 => datasources.yaml.j2} (100%) diff --git a/docker-compose/loki/datasources.j2 b/docker-compose/loki/datasources.yaml.j2 similarity index 100% rename from docker-compose/loki/datasources.j2 rename to docker-compose/loki/datasources.yaml.j2 diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index a42101ec..53f67c60 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,7 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana - - ./datasources:/etc/grafana/provisioning/dashboards + - ./datasources.yaml:/etc/grafana/provisioning/data_sources.yaml ports: - "3101:3000" networks: -- 2.43.0 From e21121ecde763384b171746638b6fdd4661f4096 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:55:13 +0200 Subject: [PATCH 24/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 53f67c60..4c820622 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,7 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana - - ./datasources.yaml:/etc/grafana/provisioning/data_sources.yaml + - ./datasources.yaml:/etc/grafana/provisioning/datasources.yaml ports: - "3101:3000" networks: -- 2.43.0 From ae7c604aa40cdc493e097db9509ac4a50ad1d437 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:57:24 +0200 Subject: [PATCH 25/46] gg --- docker-compose/loki/docker-compose.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 4c820622..5e3230f0 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -44,3 +44,4 @@ volumes: # TODO: grafana dashboard und datasource als code? + https://grafana.com/docs/grafana/latest/administration/provisioning/#datasources # TODO: URLS: http://docker10.mgrote.net:3101/explore?orgId=1&left=%7B%22datasource%22:%22U4h5CxgHz%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22U4h5CxgHz%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D + http://docker10.mgrote.net:3100/ready + http://vm-test-2204.mgrote.net:9080/config # TODO: grafana an LDAP: https://github.com/lldap/lldap/blob/main/example_configs/grafana_ldap_config.toml +# TODO: send mail testen -- 2.43.0 From 7f7df62b0d1fe644eadbb3db3a6e106f466e6338 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 21:57:52 +0200 Subject: [PATCH 26/46] gg --- docker-compose/loki/docker-compose.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 5e3230f0..742d4ad2 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -27,6 +27,7 @@ services: - "3101:3000" networks: - internal + - postfix ######## Networks ######## networks: -- 2.43.0 From 6ba71fa3f28e9726209c2696bed0835e5a9dcb0e Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:00:30 +0200 Subject: [PATCH 27/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 742d4ad2..2c07e8a8 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -22,7 +22,7 @@ services: env_file: grafana.env volumes: - grafana:/var/lib/grafana - - ./datasources.yaml:/etc/grafana/provisioning/datasources.yaml + - ./datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml ports: - "3101:3000" networks: -- 2.43.0 From ab464b9ebb641743486012acb59043f9ed733fc4 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:02:39 +0200 Subject: [PATCH 28/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 2c07e8a8..53eb4efc 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -46,3 +46,4 @@ volumes: # TODO: URLS: http://docker10.mgrote.net:3101/explore?orgId=1&left=%7B%22datasource%22:%22U4h5CxgHz%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22U4h5CxgHz%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-1h%22,%22to%22:%22now%22%7D%7D + http://docker10.mgrote.net:3100/ready + http://vm-test-2204.mgrote.net:9080/config # TODO: grafana an LDAP: https://github.com/lldap/lldap/blob/main/example_configs/grafana_ldap_config.toml # TODO: send mail testen +# TODO: depends on + healhtchecks -- 2.43.0 From d34e5394d8a8a7e8e263e85afcd16396c2dd7c18 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:06:51 +0200 Subject: [PATCH 29/46] ff --- group_vars/all.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/group_vars/all.yml b/group_vars/all.yml index df8f85e5..818c74e2 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -15,12 +15,15 @@ ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forg promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? promtail_user_additional_groups: root +promtail_config_expand_env: true +promtail_extra_args: promtail_config_scrape_configs: - job_name: system static_configs: - targets: - localhost labels: + host: ${hostname} job: varlogs __path__: /var/log/**/** # TODO add docker -- 2.43.0 From 048814f2565b42445994b7e4a88eade7ed822a85 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:07:37 +0200 Subject: [PATCH 30/46] dd --- group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 818c74e2..6400a532 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -23,7 +23,7 @@ promtail_config_scrape_configs: - targets: - localhost labels: - host: ${hostname} + host: ${HOSTNAME} job: varlogs __path__: /var/log/**/** # TODO add docker -- 2.43.0 From dfdbaaf29d23a7e9bf5b70d1feb6e3d4041730b9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:07:47 +0200 Subject: [PATCH 31/46] dd --- group_vars/all.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 6400a532..95f73222 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -16,7 +16,6 @@ promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? promtail_user_additional_groups: root promtail_config_expand_env: true -promtail_extra_args: promtail_config_scrape_configs: - job_name: system static_configs: -- 2.43.0 From 754a732c24c30ad5ed85fdbe266182f6acf489fc Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:08:13 +0200 Subject: [PATCH 32/46] dd --- group_vars/all.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 95f73222..d851479c 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -34,7 +34,8 @@ dotfiles: - user: root home: /root dotfiles_repo_url: https://git.mgrote.net/mg/dotfiles -dotfiles_vim_vundle_repo_url: "https://{{ ansible_forgejo_user | urlencode }}:{{ ansible_forgejo_user_pass | urlencode }}@git.mgrote.net/mirrors/Vundle.vim.git" +dotfiles_vim_vundle_repo_url: "https://{{ ansible_forgejo_user | urlencode }}:{{ ansible_forgejo_user_pass | urlencode }}@git.mgrote.net/mirrors/Vundle.vim.git" + ### mgrote_netplan netplan_configure: true -- 2.43.0 From 5ba85f498edab3d56f405a84b721c04e0d61beb0 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:09:46 +0200 Subject: [PATCH 33/46] dd --- group_vars/all.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index d851479c..b79b583a 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -16,13 +16,13 @@ promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? promtail_user_additional_groups: root promtail_config_expand_env: true +promtail_extra_args: "-client.external-labels=hostname=$(HOSTNAME)" promtail_config_scrape_configs: - job_name: system static_configs: - targets: - localhost labels: - host: ${HOSTNAME} job: varlogs __path__: /var/log/**/** # TODO add docker @@ -35,7 +35,6 @@ dotfiles: home: /root dotfiles_repo_url: https://git.mgrote.net/mg/dotfiles dotfiles_vim_vundle_repo_url: "https://{{ ansible_forgejo_user | urlencode }}:{{ ansible_forgejo_user_pass | urlencode }}@git.mgrote.net/mirrors/Vundle.vim.git" - ### mgrote_netplan netplan_configure: true -- 2.43.0 From 4c69a6ea17af8c220bac11d0eea624310ee9e6c9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:13:08 +0200 Subject: [PATCH 34/46] ff --- group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index b79b583a..5c3e2d97 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -16,7 +16,7 @@ promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? promtail_user_additional_groups: root promtail_config_expand_env: true -promtail_extra_args: "-client.external-labels=hostname=$(HOSTNAME)" +promtail_extra_args: "-client.external-labels=hostname={{ ansible_fqdn }}" promtail_config_scrape_configs: - job_name: system static_configs: -- 2.43.0 From 78b92044f4b692d98c8fde32902a23c8523b80d7 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:13:40 +0200 Subject: [PATCH 35/46] dd --- docker-compose/loki/loki-config.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index 162186db..4c6eca2e 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -32,3 +32,4 @@ analytics: # TODO alertmanager # TODO promtail # TODO prometheus +# TODO retention -- 2.43.0 From b72e80a0bca5d744cd125ce7541054b5e7b992f9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:18:07 +0200 Subject: [PATCH 36/46] ff --- group_vars/all.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 5c3e2d97..e3454982 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -15,17 +15,16 @@ ansible_forgejo_user_pass: "{{ lookup('viczem.keepass.keepass', 'user_setup_forg promtail_version: "3.0.0" # TODO renovate promtail_loki_server_url: "http://docker10.mgrote.net:3100" # TODO passt das für blocky? promtail_user_additional_groups: root -promtail_config_expand_env: true -promtail_extra_args: "-client.external-labels=hostname={{ ansible_fqdn }}" promtail_config_scrape_configs: - job_name: system static_configs: - targets: - localhost labels: + host: {{ ansible_fqdn }} job: varlogs __path__: /var/log/**/** -# TODO add docker +# TODO add docker und lokale logs wenn sie cniht in /var/log liegen: https://ruanbekker.medium.com/logging-with-docker-promtail-and-grafana-loki-d920fd790ca8 ### mgrote_user_setup dotfiles: -- 2.43.0 From 678751c449d9616f67c928b2f78af1ba30f1a8a9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:18:24 +0200 Subject: [PATCH 37/46] ff --- group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index e3454982..acf2c232 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -21,7 +21,7 @@ promtail_config_scrape_configs: - targets: - localhost labels: - host: {{ ansible_fqdn }} + host: "{{ ansible_fqdn }}" job: varlogs __path__: /var/log/**/** # TODO add docker und lokale logs wenn sie cniht in /var/log liegen: https://ruanbekker.medium.com/logging-with-docker-promtail-and-grafana-loki-d920fd790ca8 -- 2.43.0 From c364bb15527212c0a1f9afe6761fae7427d03ae3 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:24:39 +0200 Subject: [PATCH 38/46] dd --- docker-compose/loki/loki-config.yml.j2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index 4c6eca2e..715c7ca5 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -18,9 +18,9 @@ common: schema_config: configs: - from: 2020-10-24 - store: tsdb + store: boltdb-shipper object_store: filesystem - schema: v13 + schema: v11 index: prefix: index_ period: 24h @@ -28,6 +28,16 @@ schema_config: analytics: reporting_enabled: false +limits_config: + retention_period: 168h + +compactor: + working_directory: /loki/retention + compaction_interval: 10m + retention_enabled: true + retention_delete_delay: 2h + retention_delete_worker_count: 150 + # TODO alertmanager # TODO promtail -- 2.43.0 From 6d754a1631516143a6778592cde5f35c813a2f8d Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:28:41 +0200 Subject: [PATCH 39/46] ss --- docker-compose/loki/loki-config.yml.j2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index 715c7ca5..932b13fa 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -18,9 +18,9 @@ common: schema_config: configs: - from: 2020-10-24 - store: boltdb-shipper + store: tsdb object_store: filesystem - schema: v11 + schema: v13 index: prefix: index_ period: 24h @@ -32,6 +32,7 @@ limits_config: retention_period: 168h compactor: + delete-request-store: filesystem working_directory: /loki/retention compaction_interval: 10m retention_enabled: true -- 2.43.0 From ab6279649a347e5bbc6c3ac911587b34651a6d09 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:34:50 +0200 Subject: [PATCH 40/46] ss --- docker-compose/loki/loki-config.yml.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index 932b13fa..77847adc 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -32,12 +32,13 @@ limits_config: retention_period: 168h compactor: - delete-request-store: filesystem working_directory: /loki/retention compaction_interval: 10m retention_enabled: true retention_delete_delay: 2h retention_delete_worker_count: 150 + config: + delete-request-store: filesystem # TODO alertmanager -- 2.43.0 From ccc372d0c2d1c894b8d8e0f77af3b1e71eb94964 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:36:34 +0200 Subject: [PATCH 41/46] dd --- docker-compose/loki/loki-config.yml.j2 | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index 77847adc..c3d47411 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -5,15 +5,10 @@ server: 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: @@ -28,18 +23,6 @@ schema_config: analytics: reporting_enabled: false -limits_config: - retention_period: 168h - -compactor: - working_directory: /loki/retention - compaction_interval: 10m - retention_enabled: true - retention_delete_delay: 2h - retention_delete_worker_count: 150 - config: - delete-request-store: filesystem - # TODO alertmanager # TODO promtail -- 2.43.0 From ed956a03dcefeb8777c42e2ac533bc3d0ebdcdfe Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:37:53 +0200 Subject: [PATCH 42/46] ff --- docker-compose/loki/loki-config.yml.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index c3d47411..bc4fc604 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -5,6 +5,7 @@ server: common: instance_addr: 127.0.0.1 + path_prefix: /loki storage: filesystem: chunks_directory: /loki/chunks @@ -27,4 +28,4 @@ analytics: # TODO alertmanager # TODO promtail # TODO prometheus -# TODO retention +# TODO retention - in arbeit -- 2.43.0 From 3518b87f6ecab614871525c61e5d01ea982d3141 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:42:46 +0200 Subject: [PATCH 43/46] dcd --- docker-compose/loki/loki-config.yml.j2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index bc4fc604..bea52156 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -10,6 +10,17 @@ common: filesystem: chunks_directory: /loki/chunks rules_directory: /loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +query_range: + results_cache: + cache: + embedded_cache: + enabled: true + max_size_mb: 100 schema_config: configs: -- 2.43.0 From 24c11680b0d642dccca5941e01c1dd853428f967 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:47:06 +0200 Subject: [PATCH 44/46] ff --- docker-compose/loki/loki-config.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index bea52156..e8f707c9 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -39,4 +39,4 @@ analytics: # TODO alertmanager # TODO promtail # TODO prometheus -# TODO retention - in arbeit +# TODO retention -- 2.43.0 From a86ee43b820f9980ea5855abf7505d6e285cdc5a Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:47:54 +0200 Subject: [PATCH 45/46] dd --- docker-compose/loki/loki-config.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/loki-config.yml.j2 b/docker-compose/loki/loki-config.yml.j2 index e8f707c9..c65206f5 100644 --- a/docker-compose/loki/loki-config.yml.j2 +++ b/docker-compose/loki/loki-config.yml.j2 @@ -40,3 +40,4 @@ analytics: # TODO promtail # TODO prometheus # TODO retention +# TODO Doku wie alles zusammenspielt -- 2.43.0 From 0d746074d1588e727dcf266f56a9b2fd5ffee00c Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 23 Sep 2024 22:52:23 +0200 Subject: [PATCH 46/46] dd --- docker-compose/loki/docker-compose.yml.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose/loki/docker-compose.yml.j2 b/docker-compose/loki/docker-compose.yml.j2 index 53eb4efc..1edf17e9 100644 --- a/docker-compose/loki/docker-compose.yml.j2 +++ b/docker-compose/loki/docker-compose.yml.j2 @@ -47,3 +47,4 @@ volumes: # TODO: grafana an LDAP: https://github.com/lldap/lldap/blob/main/example_configs/grafana_ldap_config.toml # TODO: send mail testen # TODO: depends on + healhtchecks +# TODO Mikrotik in Logging? oder lieber alles rsyslog -- 2.43.0