alloy
This commit is contained in:
parent
973e22e267
commit
73f1874a59
4 changed files with 148 additions and 3 deletions
63
inventories/eh22/host_vars/dhcp.yaml
Normal file
63
inventories/eh22/host_vars/dhcp.yaml
Normal file
|
@ -0,0 +1,63 @@
|
|||
alloy_config: |
|
||||
prometheus.remote_write "default" {
|
||||
endpoint {
|
||||
url = "http://mimir.noc.eh22.intern/api/v1/push"
|
||||
basic_auth {
|
||||
username = "noc"
|
||||
password = "{{ (lookup('community.sops.sops', 'secrets/passwords.yaml') | ansible.builtin.from_yaml)['services']['mimir']['basic_auth'] }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "http://loki.noc.eh22.intern/loki/api/v1/push"
|
||||
basic_auth {
|
||||
username = "noc"
|
||||
password = "{{ (lookup('community.sops.sops', 'secrets/passwords.yaml') | ansible.builtin.from_yaml)['services']['loki']['basic_auth'] }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loki.relabel "journal" {
|
||||
forward_to = []
|
||||
|
||||
rule {
|
||||
source_labels = ["__journal__systemd_unit"]
|
||||
target_label = "systemd_unit"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal__hostname"]
|
||||
target_label = "instance"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal__transport"]
|
||||
target_label = "systemd_transport"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal_syslog_identifier"]
|
||||
target_label = "syslog_identifier"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal_priority_keyword"]
|
||||
target_label = "level"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.journal "read_journal" {
|
||||
forward_to = [loki.write.default.receiver]
|
||||
relabel_rules = loki.relabel.journal.rules
|
||||
format_as_json = true
|
||||
labels = {component = "loki.source.journal", host = "dhcp"}
|
||||
}
|
||||
|
||||
logging {
|
||||
level = "info"
|
||||
}
|
||||
prometheus.exporter.unix "local_system" { }
|
||||
|
||||
prometheus.scrape "scrape_metrics" {
|
||||
targets = prometheus.exporter.unix.local_system.targets
|
||||
forward_to = [prometheus.remote_write.default.receiver]
|
||||
scrape_interval = "10s"
|
||||
}
|
||||
|
63
inventories/eh22/host_vars/resolv-dns.yaml
Normal file
63
inventories/eh22/host_vars/resolv-dns.yaml
Normal file
|
@ -0,0 +1,63 @@
|
|||
alloy_config: |
|
||||
prometheus.remote_write "default" {
|
||||
endpoint {
|
||||
url = "http://mimir.noc.eh22.intern/api/v1/push"
|
||||
basic_auth {
|
||||
username = "noc"
|
||||
password = "{{ (lookup('community.sops.sops', 'secrets/passwords.yaml') | ansible.builtin.from_yaml)['services']['mimir']['basic_auth'] }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
loki.write "default" {
|
||||
endpoint {
|
||||
url = "http://loki.noc.eh22.intern/loki/api/v1/push"
|
||||
basic_auth {
|
||||
username = "noc"
|
||||
password = "{{ (lookup('community.sops.sops', 'secrets/passwords.yaml') | ansible.builtin.from_yaml)['services']['loki']['basic_auth'] }}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loki.relabel "journal" {
|
||||
forward_to = []
|
||||
|
||||
rule {
|
||||
source_labels = ["__journal__systemd_unit"]
|
||||
target_label = "systemd_unit"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal__hostname"]
|
||||
target_label = "instance"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal__transport"]
|
||||
target_label = "systemd_transport"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal_syslog_identifier"]
|
||||
target_label = "syslog_identifier"
|
||||
}
|
||||
rule {
|
||||
source_labels = ["__journal_priority_keyword"]
|
||||
target_label = "level"
|
||||
}
|
||||
}
|
||||
|
||||
loki.source.journal "read_journal" {
|
||||
forward_to = [loki.write.default.receiver]
|
||||
relabel_rules = loki.relabel.journal.rules
|
||||
format_as_json = true
|
||||
labels = {component = "loki.source.journal", host = "resolv-dns"}
|
||||
}
|
||||
|
||||
logging {
|
||||
level = "info"
|
||||
}
|
||||
prometheus.exporter.unix "local_system" { }
|
||||
|
||||
prometheus.scrape "scrape_metrics" {
|
||||
targets = prometheus.exporter.unix.local_system.targets
|
||||
forward_to = [prometheus.remote_write.default.receiver]
|
||||
scrape_interval = "10s"
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue