Remove lgtm stack and influxdb
Removed loki, grafana, mimir, alloy and node_exporter To be replaced with an lgtm cluster and checkmk
This commit is contained in:
parent
1417a4585b
commit
b5256dd831
15 changed files with 0 additions and 660 deletions
|
|
@ -1,72 +0,0 @@
|
|||
---
|
||||
influxdb_svc:
|
||||
domain: "{{ all_services | service_get_domain(service_name) }}"
|
||||
port: 8086
|
||||
data_dir: /var/lib/influxdb2
|
||||
|
||||
influxdb_yml:
|
||||
assets-path: ""
|
||||
bolt-path: "{{ (svc.data_dir, 'influxd.bolt') | path_join }}"
|
||||
e2e-testing: false
|
||||
engine-path: "{{ (svc.data_dir, 'engine') | path_join }}"
|
||||
feature-flags: {}
|
||||
http-bind-address: "0.0.0.0:{{ svc.port }}"
|
||||
influxql-max-select-buckets: 0
|
||||
influxql-max-select-point: 0
|
||||
influxql-max-select-series: 0
|
||||
key-name: ""
|
||||
log-level: info
|
||||
nats-max-payload-bytes: 1048576
|
||||
nats-port: 4222
|
||||
no-tasks: false
|
||||
query-concurrency: 10
|
||||
query-initial-memory-bytes: 0
|
||||
query-max-memory-bytes: 0
|
||||
query-memory-bytes: 9223372036854775807
|
||||
query-queue-size: 10
|
||||
reporting-disabled: false
|
||||
secret-store: bolt
|
||||
session-length: 60
|
||||
session-renew-disabled: false
|
||||
storage-cache-max-memory-size: 1073741824
|
||||
storage-cache-snapshot-memory-size: 26214400
|
||||
storage-cache-snapshot-write-cold-duration: 10m0s
|
||||
storage-compact-full-write-cold-duration: 4h0m0s
|
||||
storage-compact-throughput-burst: 50331648
|
||||
storage-max-concurrent-compactions: 0
|
||||
storage-max-index-log-file-size: 1048576
|
||||
storage-retention-check-interval: 30m0s
|
||||
storage-series-file-max-concurrent-snapshot-compactions: 0
|
||||
storage-series-id-set-cache-size: 0
|
||||
storage-shard-precreator-advance-period: 30m0s
|
||||
storage-shard-precreator-check-interval: 10m0s
|
||||
storage-tsm-use-madv-willneed: false
|
||||
storage-validate-keys: false
|
||||
storage-wal-fsync-delay: "0s"
|
||||
store: bolt
|
||||
testing-always-allow-setup: false
|
||||
tls-cert: ""
|
||||
tls-key: ""
|
||||
tls-min-version: "1.2"
|
||||
tls-strict-ciphers: false
|
||||
tracing-type: ""
|
||||
vault-addr: ""
|
||||
vault-cacert: ""
|
||||
vault-capath: ""
|
||||
vault-client-cert: ""
|
||||
vault-client-key: ""
|
||||
vault-client-timeout: "0s"
|
||||
vault-max-retries: 0
|
||||
vault-skip-verify: false
|
||||
vault-tls-server-name: ""
|
||||
vault-token: ""
|
||||
|
||||
influxdb_compose:
|
||||
watchtower: monitor
|
||||
image: influxdb:2.7
|
||||
volumes:
|
||||
- ./influxdb.yml:/etc/influxdb2/config.yml
|
||||
- data:{{ svc.data_dir }}
|
||||
file:
|
||||
volumes:
|
||||
data:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
- name: Restart service influxdb
|
||||
ansible.builtin.include_tasks: tasks/restart-service.yml
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ service_name }}
|
||||
vars:
|
||||
svc: "{{ influxdb_svc }}"
|
||||
env: "{{ influxdb_env }}"
|
||||
compose: "{{ influxdb_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Create config
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ (service_path, 'influxdb.yml') | path_join }}"
|
||||
content: '{{ influxdb_yml | to_nice_yaml }}'
|
||||
mode: "0644"
|
||||
notify: Restart service {{ service_name }}
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
---
|
||||
lgtm_stack_domain: "{{ all_services | service_get_domain(service_name) }}"
|
||||
lgtm_stack_mimir_domain: mimir.serguzim.me
|
||||
lgtm_stack_alloy_domain: alloy.serguzim.me
|
||||
lgtm_stack_loki_domain: "{{ all_services | service_get_domain('loki') }}"
|
||||
|
||||
lgtm_stack_alloy_jobs: "{{ all_services | lgtm_stack_services_to_alloy() }}"
|
||||
|
||||
lgtm_stack_grafana_secret_key: "{{ undef() }}"
|
||||
|
||||
|
||||
lgtm_stack_svc:
|
||||
domain: "{{ lgtm_stack_domain }}"
|
||||
port: 3000
|
||||
extra_svcs:
|
||||
- domain: "{{ lgtm_stack_alloy_domain }}"
|
||||
docker_host: lgtm_stack_alloy
|
||||
port: 12345
|
||||
caddy_extra: import vpn_only
|
||||
- domain: "{{ lgtm_stack_mimir_domain }}"
|
||||
docker_host: lgtm_stack_mimir
|
||||
port: 9009
|
||||
caddy_extra: import vpn_only
|
||||
postgresql_collector:
|
||||
host: "{{ postgres.host }}"
|
||||
port: "{{ postgres.port }}"
|
||||
user: "{{ opentofu.postgresql_metrics_collector.user }}"
|
||||
pass: "{{ opentofu.postgresql_metrics_collector.pass }}"
|
||||
database: "{{ opentofu.postgresql_metrics_collector.database }}"
|
||||
|
||||
lgtm_stack_env:
|
||||
|
||||
GF_DEFAULT_INSTANCE_NAME: "{{ lgtm_stack_domain }}"
|
||||
GF_SERVER_PROTOCOL: "http"
|
||||
GF_SERVER_DOMAIN: "{{ lgtm_stack_domain }}"
|
||||
GF_SERVER_ROOT_URL: "https://{{ lgtm_stack_domain }}/"
|
||||
|
||||
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: true
|
||||
GF_SECURITY_ADMIN_USER: "{{ admin_email }}"
|
||||
GF_SECURITY_SECRET_KEY: "{{ lgtm_stack_grafana_secret_key | mandatory }}"
|
||||
GF_SECURITY_COOKIE_SECURE: true
|
||||
GF_SECURITY_COOKIE_SAMESITE: "strict"
|
||||
|
||||
GF_PLUGINS_PLUGIN_ADMIN_ENABLED: true
|
||||
|
||||
GF_DATABASE_TYPE: "postgres"
|
||||
GF_DATABASE_HOST: "{{ postgres.host }}"
|
||||
GF_DATABASE_NAME: "{{ opentofu.postgresql_data.lgtm_stack.database }}"
|
||||
GF_DATABASE_USER: "{{ opentofu.postgresql_data.lgtm_stack.user }}"
|
||||
GF_DATABASE_PASSWORD: "{{ opentofu.postgresql_data.lgtm_stack.pass }}"
|
||||
GF_DATABASE_SSL_MODE: "verify-full"
|
||||
|
||||
GF_USERS_ALLOW_SIGN_UP: false
|
||||
GF_AUTH_DISABLE_LOGIN_FORM: true
|
||||
GF_SIGNOUT_REDIRECT_URL: "https://{{ lgtm_stack_domain }}/"
|
||||
GF_OAUTH_AUTO_LOGIN: true
|
||||
GF_AUTH_ANONYMOUS_ENABLED: false
|
||||
GF_AUTH_ANONYMOUS_ORG_NAME: "Main Org."
|
||||
GF_AUTH_ANONYMOUS_ORG_ROLE: "Viewer"
|
||||
GF_AUTH_GENERIC_OAUTH_ENABLED: true
|
||||
GF_AUTH_GENERIC_OAUTH_NAME: "auth.serguzim.me"
|
||||
GF_AUTH_GENERIC_OAUTH_ALLOW_SIGN_UP: true
|
||||
GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH: "\
|
||||
contains(groups, 'Grafana GrafanaAdmins') && 'GrafanaAdmin'
|
||||
|| contains(groups, 'Grafana Admins') && 'Admin'
|
||||
|| contains(groups, 'Grafana Editors') && 'Editor' || 'Viewer'"
|
||||
GF_AUTH_GENERIC_OAUTH_ALLOW_ASSIGN_GRAFANA_ADMIN: true
|
||||
GF_AUTH_GENERIC_OAUTH_CLIENT_ID: "{{ opentofu.authentik_data.lgtm_stack.client_id }}"
|
||||
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET: "{{ opentofu.authentik_data.lgtm_stack.client_secret }}"
|
||||
GF_AUTH_GENERIC_OAUTH_SCOPES: "openid profile email"
|
||||
GF_AUTH_GENERIC_OAUTH_AUTH_URL: "https://auth.serguzim.me/application/o/authorize/"
|
||||
GF_AUTH_GENERIC_OAUTH_TOKEN_URL: "https://auth.serguzim.me/application/o/token/"
|
||||
GF_AUTH_GENERIC_OAUTH_API_URL: "https://auth.serguzim.me/application/o/userinfo/"
|
||||
GF_AUTH_SIGNOUT_REDIRECT_URL: "{{ (opentofu.authentik_data.lgtm_stack.base_url, 'end-session') | path_join }}/"
|
||||
GF_AUTH_OAUTH_AUTO_LOGIN: true
|
||||
|
||||
GF_SMTP_ENABLED: true
|
||||
GF_SMTP_HOST: "{{ mailer.host }}:{{ mailer.port }}"
|
||||
GF_SMTP_USER: "{{ opentofu.mailcow_data.lgtm_stack.address }}"
|
||||
GF_SMTP_PASSWORD: "{{ opentofu.mailcow_data.lgtm_stack.password }}"
|
||||
GF_SMTP_FROM_ADDRESS: "{{ opentofu.mailcow_data.lgtm_stack.address }}"
|
||||
GF_SMTP_FROM_NAME: "Monitoring"
|
||||
|
||||
lgtm_stack_grafana_datasources:
|
||||
apiVersion: 1
|
||||
|
||||
deleteDatasources:
|
||||
- name: Mimir
|
||||
|
||||
datasources:
|
||||
- name: Mimir
|
||||
type: prometheus
|
||||
access: proxy
|
||||
orgId: 1
|
||||
url: "https://{{ lgtm_stack_mimir_domain }}/prometheus"
|
||||
version: 1
|
||||
editable: true
|
||||
jsonData:
|
||||
timeInterval: 60s
|
||||
prometheusType: Mimir
|
||||
|
||||
lgtm_stack_mimir_yml:
|
||||
multitenancy_enabled: false
|
||||
target: all
|
||||
|
||||
common:
|
||||
storage:
|
||||
backend: s3
|
||||
s3:
|
||||
endpoint: "{{ opentofu.scaleway_data.mimir_blocks.api_endpoint | regex_replace('^https://', '') }}"
|
||||
region: "{{ opentofu.scaleway_data.mimir_blocks.region }}"
|
||||
access_key_id: "{{ opentofu.scaleway_data.mimir_blocks.access_key }}"
|
||||
secret_access_key: "{{ opentofu.scaleway_data.mimir_blocks.secret_key }}"
|
||||
blocks_storage:
|
||||
s3:
|
||||
bucket_name: "{{ opentofu.scaleway_data.mimir_blocks.name }}"
|
||||
alertmanager_storage:
|
||||
s3:
|
||||
bucket_name: "{{ opentofu.scaleway_data.mimir_alertmanager.name }}"
|
||||
ruler_storage:
|
||||
s3:
|
||||
bucket_name: "{{ opentofu.scaleway_data.mimir_ruler.name }}"
|
||||
|
||||
server:
|
||||
http_listen_port: 9009
|
||||
|
||||
# Configure the server to allow messages up to 100MB.
|
||||
grpc_server_max_recv_msg_size: 104857600
|
||||
grpc_server_max_send_msg_size: 104857600
|
||||
grpc_server_max_concurrent_streams: 1000
|
||||
|
||||
ingester:
|
||||
ring:
|
||||
replication_factor: 1
|
||||
|
||||
lgtm_stack_compose:
|
||||
watchtower: update
|
||||
image: grafana/grafana-oss
|
||||
volumes:
|
||||
- ./datasources:/etc/grafana/provisioning/datasources
|
||||
- grafana-data:/var/lib/grafana
|
||||
file:
|
||||
services:
|
||||
alloy:
|
||||
image: grafana/alloy:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./config.alloy:/etc/alloy/config.alloy:ro
|
||||
command:
|
||||
- run
|
||||
- /etc/alloy/config.alloy
|
||||
- --storage.path=/var/lib/alloy/data
|
||||
- --server.http.listen-addr=0.0.0.0:12345
|
||||
- --stability.level=experimental
|
||||
networks:
|
||||
apps:
|
||||
aliases:
|
||||
- lgtm_stack_alloy
|
||||
default:
|
||||
|
||||
mimir:
|
||||
image: grafana/mimir:latest
|
||||
restart: always
|
||||
command:
|
||||
- -config.file=/etc/mimir-config/mimir.yaml
|
||||
volumes:
|
||||
- ./mimir.yaml:/etc/mimir-config/mimir.yaml:ro
|
||||
networks:
|
||||
default:
|
||||
apps:
|
||||
aliases:
|
||||
- lgtm_stack_mimir
|
||||
volumes:
|
||||
grafana-data:
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
def transfer_optional_param(source, target, name, target_name=None):
|
||||
if param := source.get(name):
|
||||
target[target_name or name] = param
|
||||
|
||||
class FilterModule(object):
|
||||
def filters(self):
|
||||
return {
|
||||
'lgtm_stack_services_to_alloy': self.services_to_alloy,
|
||||
}
|
||||
|
||||
def services_to_alloy(self, services):
|
||||
result = []
|
||||
|
||||
for name, service in services.items():
|
||||
if not bool(service.get("host")):
|
||||
continue
|
||||
|
||||
if targets := service.get("metrics") or []:
|
||||
job = {
|
||||
"name": name,
|
||||
"targets": [],
|
||||
"scrape_interval": "60s",
|
||||
}
|
||||
|
||||
for target in targets:
|
||||
|
||||
address = target.get("address") or service["dns"][0]['domain']
|
||||
|
||||
transfer_optional_param(target, job, "interval", "scrape_interval")
|
||||
|
||||
new_target = {
|
||||
"address": address,
|
||||
"path": target["path"],
|
||||
"instance": name
|
||||
}
|
||||
|
||||
transfer_optional_param(target, new_target, "instance")
|
||||
transfer_optional_param(target, new_target, "job")
|
||||
|
||||
job["targets"].append(new_target)
|
||||
|
||||
result.append(job)
|
||||
|
||||
return result
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
- name: Restart service lgtm_stack
|
||||
ansible.builtin.include_tasks: tasks/restart-service.yml
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
- name: Set grafana datasources path
|
||||
ansible.builtin.set_fact:
|
||||
lgtm_stack_datasources_path: "{{ (service_path, 'datasources') | path_join }}"
|
||||
|
||||
- name: Create datasources directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ lgtm_stack_datasources_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Create default datasources
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ (lgtm_stack_datasources_path, 'default.yaml') | path_join }}"
|
||||
content: '{{ lgtm_stack_grafana_datasources | to_nice_yaml }}'
|
||||
mode: "0644"
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ service_name }}
|
||||
vars:
|
||||
svc: "{{ lgtm_stack_svc }}"
|
||||
env: "{{ lgtm_stack_env }}"
|
||||
compose: "{{ lgtm_stack_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Run grafana specific tasks
|
||||
ansible.builtin.import_tasks: grafana.yml
|
||||
|
||||
- name: Template alloy config file
|
||||
ansible.builtin.template:
|
||||
src: config.alloy.j2
|
||||
dest: "{{ (service_path, 'config.alloy') | path_join }}"
|
||||
mode: "0644"
|
||||
notify: Restart service {{ service_name }}
|
||||
|
||||
- name: Create mimir config
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ (service_path, 'mimir.yaml') | path_join }}"
|
||||
content: '{{ lgtm_stack_mimir_yml | to_nice_yaml }}'
|
||||
mode: "0644"
|
||||
notify: Restart service {{ service_name }}
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
logging {
|
||||
level = "info"
|
||||
write_to = [loki.relabel.alloy_logs.receiver]
|
||||
}
|
||||
|
||||
prometheus.remote_write "mimir" {
|
||||
endpoint {
|
||||
url = "https://{{ lgtm_stack_mimir_domain }}/api/v1/push"
|
||||
}
|
||||
}
|
||||
|
||||
prometheus.exporter.self "alloy" {}
|
||||
prometheus.scrape "alloy" {
|
||||
targets = prometheus.exporter.self.alloy.targets
|
||||
forward_to = [prometheus.remote_write.mimir.receiver]
|
||||
}
|
||||
|
||||
prometheus.exporter.postgres "default" {
|
||||
data_source_names = ["postgresql://{{ svc.postgresql_collector.user }}:{{ svc.postgresql_collector.pass }}@{{ svc.postgresql_collector.host }}:{{ svc.postgresql_collector.port }}/{{ svc.postgresql_collector.database }}?sslmode=verify-full"]
|
||||
|
||||
autodiscovery {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
prometheus.scrape "postgres" {
|
||||
targets = prometheus.exporter.postgres.default.targets
|
||||
forward_to = [prometheus.remote_write.mimir.receiver]
|
||||
}
|
||||
|
||||
prometheus.scrape "node_exporter" {
|
||||
targets = [
|
||||
{% for host_data in opentofu.hosts.values() %}
|
||||
{"__address__" = "{{ host_data.fqdn_vpn }}:9100", "instance" = "{{ host_data.hostname }}"},
|
||||
{% endfor %}
|
||||
]
|
||||
forward_to = [prometheus.remote_write.mimir.receiver]
|
||||
}
|
||||
|
||||
prometheus.scrape "caddy" {
|
||||
targets = [
|
||||
{% for host_data in opentofu.hosts.values() %}
|
||||
{"__address__" = "{{ host_data.fqdn_vpn }}", "instance" = "{{ host_data.hostname }}"},
|
||||
{% endfor %}
|
||||
]
|
||||
forward_to = [prometheus.remote_write.mimir.receiver]
|
||||
}
|
||||
|
||||
|
||||
{% for job in lgtm_stack_alloy_jobs %}
|
||||
|
||||
prometheus.scrape "{{ job.name }}" {
|
||||
targets = [
|
||||
{% for target in job.targets %}
|
||||
{
|
||||
"__address__" = "{{ target.address }}",
|
||||
"__metrics_path__" = "{{ target.path }}",
|
||||
"__scheme__" = "https",
|
||||
{% if 'job' in target %}"job" = "{{ target.job }}",{% endif %}
|
||||
{% if 'instance' in target %}"instance" = "{{ target.instance }}",{% endif %}
|
||||
},
|
||||
{% endfor %}
|
||||
]
|
||||
|
||||
scrape_interval = "{{ job.scrape_interval }}"
|
||||
forward_to = [prometheus.remote_write.mimir.receiver]
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
loki.write "loki" {
|
||||
endpoint {
|
||||
url = "https://{{ lgtm_stack_loki_domain }}/loki/api/v1/push"
|
||||
}
|
||||
}
|
||||
|
||||
loki.relabel "alloy_logs" {
|
||||
rule {
|
||||
target_label = "instance"
|
||||
replacement = "{{ inventory_hostname }}"
|
||||
}
|
||||
|
||||
rule {
|
||||
target_label = "job"
|
||||
replacement = "integrations/self"
|
||||
}
|
||||
|
||||
forward_to = [loki.write.loki.receiver]
|
||||
}
|
||||
|
||||
discovery.docker "linux" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
|
||||
filter {
|
||||
name = "label"
|
||||
values = ["net.serguzim.logs.collect=true"]
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.docker "default" {
|
||||
host = "unix:///var/run/docker.sock"
|
||||
targets = discovery.docker.linux.targets
|
||||
labels = {"app" = "docker"}
|
||||
relabel_rules = discovery.relabel.logs_docker_containers.rules
|
||||
forward_to = [loki.write.loki.receiver]
|
||||
}
|
||||
|
||||
discovery.relabel "logs_docker_containers" {
|
||||
targets = []
|
||||
rule {
|
||||
source_labels = ["__meta_docker_container_label_com_docker_compose_project"]
|
||||
target_label = "compose_project"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_docker_container_label_com_docker_compose_service"]
|
||||
target_label = "compose_service"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_docker_container_name"]
|
||||
target_label = "container_name"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
---
|
||||
loki_svc:
|
||||
domain: "{{ all_services | service_get_domain(service_name) }}"
|
||||
port: 3100
|
||||
caddy_extra: import vpn_only
|
||||
|
||||
loki_yml: # https://grafana.com/docs/loki/latest/configure/examples/configuration-examples/#2-s3-cluster-exampleyaml
|
||||
auth_enabled: false
|
||||
|
||||
common:
|
||||
storage:
|
||||
s3:
|
||||
s3forcepathstyle: true
|
||||
bucketnames: "{{ opentofu.minio_data.loki.name }}"
|
||||
endpoint: "{{ opentofu.minio_data.loki.api_endpoint }}"
|
||||
region: "{{ opentofu.minio_data.loki.region }}"
|
||||
access_key_id: "{{ opentofu.minio_data.loki.access_key }}"
|
||||
secret_access_key: "{{ opentofu.minio_data.loki.secret_key }}"
|
||||
ring:
|
||||
instance_addr: 127.0.0.1
|
||||
kvstore:
|
||||
store: inmemory
|
||||
replication_factor: 1
|
||||
path_prefix: /loki
|
||||
|
||||
ui:
|
||||
enabled: true
|
||||
|
||||
storage_config:
|
||||
tsdb_shipper:
|
||||
active_index_directory: /loki/index
|
||||
cache_location: /loki/index_cache
|
||||
|
||||
schema_config:
|
||||
configs:
|
||||
- from: "2020-05-15"
|
||||
store: tsdb
|
||||
object_store: s3
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
compactor:
|
||||
working_directory: /loki/compactor
|
||||
|
||||
|
||||
loki_compose:
|
||||
watchtower: update
|
||||
image: grafana/loki:latest
|
||||
volumes:
|
||||
- ./loki.yaml:/etc/loki-config/loki.yaml:ro
|
||||
file:
|
||||
services:
|
||||
app:
|
||||
command:
|
||||
- -config.file=/etc/loki-config/loki.yaml
|
||||
volumes:
|
||||
data:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
- name: Restart service loki
|
||||
ansible.builtin.include_tasks: tasks/restart-service.yml
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ service_name }}
|
||||
vars:
|
||||
svc: "{{ loki_svc }}"
|
||||
compose: "{{ loki_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Create loki config
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ (service_path, 'loki.yaml') | path_join }}"
|
||||
content: '{{ loki_yml | to_nice_yaml }}'
|
||||
mode: "0644"
|
||||
notify: Restart service {{ service_name }}
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
node_exporter_disabled_collectors:
|
||||
- "textfile"
|
||||
|
||||
node_exporter_enabled_collectors:
|
||||
- "systemd"
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
- name: Deploy {{ service_name }}
|
||||
ansible.builtin.import_role:
|
||||
name: prometheus.prometheus.node_exporter
|
||||
|
|
@ -375,30 +375,6 @@ services = {
|
|||
database = false
|
||||
},
|
||||
|
||||
"influxdb" = {
|
||||
host = "node001"
|
||||
dns = [{
|
||||
domain = "tick.serguzim.me"
|
||||
}]
|
||||
backup = [{
|
||||
name = "influxdb_data"
|
||||
type = "docker"
|
||||
}]
|
||||
metrics = [{
|
||||
path = "/metrics"
|
||||
}]
|
||||
monitoring = {
|
||||
url = "/health"
|
||||
group = "3-services"
|
||||
conditions = [
|
||||
"DEFAULT",
|
||||
"[BODY].status == pass"
|
||||
]
|
||||
}
|
||||
auth = false
|
||||
database = false
|
||||
},
|
||||
|
||||
"jellyfin" = {
|
||||
host = ""
|
||||
dns = [{
|
||||
|
|
@ -512,53 +488,6 @@ services = {
|
|||
database = false
|
||||
},
|
||||
|
||||
"lgtm_stack" = {
|
||||
host = "node001"
|
||||
dns = [
|
||||
{
|
||||
domain = "monitoring.serguzim.me"
|
||||
},
|
||||
{
|
||||
domain = "alloy.serguzim.me"
|
||||
name = "alloy"
|
||||
vpn = true
|
||||
},
|
||||
{
|
||||
domain = "mimir.serguzim.me"
|
||||
name = "mimir"
|
||||
vpn = true
|
||||
}
|
||||
]
|
||||
monitoring = {
|
||||
url = "/api/health"
|
||||
group = "7-support"
|
||||
conditions = [
|
||||
"DEFAULT",
|
||||
"[BODY].database == ok"
|
||||
]
|
||||
}
|
||||
auth = true
|
||||
auth_redirects = ["https://monitoring.serguzim.me/login/generic_oauth"]
|
||||
database = true
|
||||
s3 = "external"
|
||||
s3_buckets = ["mimir_blocks", "mimir_alertmanager", "mimir_ruler"]
|
||||
mail = "monitoring@serguzim.me"
|
||||
}
|
||||
|
||||
"loki" = {
|
||||
host = "node001"
|
||||
dns = [
|
||||
{
|
||||
domain = "loki.serguzim.me"
|
||||
name = "loki"
|
||||
vpn = true
|
||||
}
|
||||
]
|
||||
auth = false
|
||||
database = false
|
||||
s3 = "internal"
|
||||
}
|
||||
|
||||
"minecraft_3" = {
|
||||
host = ""
|
||||
dns = [
|
||||
|
|
@ -614,12 +543,6 @@ services = {
|
|||
database = false
|
||||
},
|
||||
|
||||
"node_exporter" = {
|
||||
host = "*"
|
||||
auth = false
|
||||
database = false
|
||||
},
|
||||
|
||||
"ntfy" = {
|
||||
host = "node001"
|
||||
dns = [{
|
||||
|
|
|
|||
Loading…
Reference in a new issue