!coeAONBrWyDJnYMbMi:nixos.org

NixOS System Operations

589 Members
About system administration for running NixOS systems in production. Declaratively manage your operations. | Room recommendations: #networking:nixos.org157 Servers

Load older messages


SenderMessageTime
8 Dec 2024
@hexa:lossy.networkhexa
      ruler = {
        storage = {
          type = "local";
          local.directory = "/etc/loki/rules/";
        };
        rule_path = "/tmp/loki-rules-scratch";
        alertmanager_url = "http://127.0.0.1:9093";
        ring.kvstore.store = "inmemory";
      };
19:35:51
@hexa:lossy.networkhexa so am I holding the ruler wrong? K900 maybe? 19:36:01
@k900:0upti.meK900Hmm 19:40:06
@k900:0upti.meK900Sus 19:40:12
@hexa:lossy.networkhexalike I can't even browse the rules it loads, because that wants a stupid tenant id? 😄 19:43:37
@hexa:lossy.networkhexa
# lokitool rules print --address https://loki.lossy.network --id=1
INFO[0000] no rule groups currently exist for this user 
19:44:29
@hexa:lossy.networkhexa

When configured with auth_enabled: false, Loki uses a single tenant. [...] The single tenant ID will be the string fake.

19:45:11
@hexa:lossy.networkhexa
# lokitool rules print --address https://loki.lossy.network --id=fake
INFO[0000] no rule groups currently exist for this user 
19:45:21
@hexa:lossy.networkhexaso it doesn't even load the rules? 🤔19:45:56
@hexa:lossy.networkhexapretty sure this used to work before 3.019:46:56
@hexa:lossy.networkhexaok, so the rules now need to be below ${local.directory}/<tenant>/20:21:08
@hexa:lossy.networkhexa

caller=ruler.go:576 msg="unable to list rules" err="failed to list rule groups for user fake: failed to list rule group for user fake and namespace rules.yaml: error parsing /etc/loki/rules/fake/rules.yaml: /etc/loki/rules/fake/rules.yaml: yaml: unmarshal errors:\n line 1: field namespace not found in type rulefmt.RuleGroups"

20:21:17
@hexa:lossy.networkhexaand mine are now missing a namespace20:21:31
@hexa:lossy.networkhexaRedacted or Malformed Event20:26:17
@hexa:lossy.networkhexaso the linter is now happy with my rules file but loki isn't20:28:02
@hexa:lossy.networkhexaok, so the linter adds a namespace key to the file and loki does not like it20:35:35
@hexa:lossy.networkhexaclownshow20:35:37
@hexa:lossy.networkhexa K900: getting back to your expression recommendation now 20:36:03
@hexa:lossy.networkhexa
rule_name=PostgresqlCollationMismatch rule_type=alerting query="{unit=\"postgresql.service\"} |~ \"database \\\"[^\\\"]+\\\" has a collation version mismatch\" | regexp \"database \\\"(?<database>[^\\\"]+)\\\"\"" query_hash=2906991201 msg="rule result is not a vector or scalar" err=null
20:36:21
@hexa:lossy.networkhexa

rule result is not a vector or scalar

20:36:33
@hexa:lossy.networkhexaimage.png
Download image.png
20:37:52
@hexa:lossy.networkhexaat least that works now20:37:56
@hexa:lossy.networkhexa so count_over_time is always implied for event logging 20:46:13
@adam:robins.wtfadamcstephensi guess that makes sense?22:33:45
@hexa:lossy.networkhexayeah, k900 implied it wasn't yesterday fwiw22:42:28
@hexa:lossy.networkhexawhich would make queries much more easy to write in the face of how badly the feedback of the ruler is22:43:06
@hexa:lossy.networkhexaat least I'm now getting fast feedback22:46:27
@hexa:lossy.networkhexa
building '/nix/store/3f7ww8pjj8v32w45vcflz6l7lvc767vp-rules.yaml.drv'...
ERRO[0000] unable parse rules file                       error="could not parse expression for alert 'PostgresqlCollationMismatch' in group 'postgresql': parse error at line 5, col 1: syntax error: unexpected $end, expecting )" file=/nix/store/b90hjjsvamndv0z2a9vqfz91w66lbc43-rules.yaml
lokitool: error: prepare operation unsuccessful, unable to parse rules files: file read error, try --help
error: builder for '/nix/store/3f7ww8pjj8v32w45vcflz6l7lvc767vp-rules.yaml.drv' failed with exit code 1;
       last 2 log lines:
       > ERRO[0000] unable parse rules file                       error="could not parse expression for alert 'PostgresqlCollationMismatch' in group 'postgresql': parse error at line 5, col 1: syntax error: unexpected $end, expecting )" file=/nix/store/b90hjjsvamndv0z2a9vqfz91w66lbc43-rules.yaml
       > lokitool: error: prepare operation unsuccessful, unable to parse rules files: file read error, try --help
       For full logs, run 'nix log /nix/store/3f7ww8pjj8v32w45vcflz6l7lvc767vp-rules.yaml.drv'.
22:46:30
@hexa:lossy.networkhexafinally22:50:39
@hexa:lossy.networkhexaimage.png
Download image.png
22:50:39

Show newer messages


Back to Room ListRoom Version: 10