!coeAONBrWyDJnYMbMi:nixos.org

NixOS System Operations

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

Load older messages


SenderMessageTime
7 Dec 2024
@sigmasquadron:matrix.orgSigmaSquadron joined the room.22:12:38
@hexa:lossy.networkhexaanyone here who happily uses loki with rules and alerting?22:15:06
@hexa:lossy.networkhexa * anyone here who happily uses loki with rules and alerting and considers it useful? 22:30:51
@k900:0upti.meK900 I don't have any alerts in it right now, but I've done that before at $work and yes it is useful IF you know what to alert on 22:35:54
@hexa:lossy.networkhexaI find writing the expressions super tedious22:37:19
@hexa:lossy.networkhexaand since I mostly want to log on events it always follows the same pattern22:38:08
@hexa:lossy.networkhexa
sum by (machine) (count_over_time({...})
  |~ "some match" [5m]
)) >0
22:38:50
@hexa:lossy.networkhexa *
sum by (machine) (count_over_time({...}
  |~ "some match" [5m]
)) >0
22:39:05
@k900:0upti.meK900It depends on what you're setting up alerts for tbh 22:39:16
@hexa:lossy.networkhexayeah, 110% events22:39:25
@hexa:lossy.networkhexanot really rates and whatever they think of examples22:39:46
@k900:0upti.meK900I think you can just drop most of that then and just have the filter as the rule 22:41:22
@k900:0upti.meK900And it'll alert if anything matches 22:41:27
@hexa:lossy.networkhexahuh, ok22:41:45
@hexa:lossy.networkhexathat is kinda the simplicity I was looking for22:42:04
@hexa:lossy.networkhexa
      {unit="postgresql.service"}
        |~ "ALTER DATABASE \\w+ REFRESH COLLATION VERSION"
        | regexp "DATABASE (?<database>[a-zA-Z0-9]+) REFRESH" [5m]
22:42:59
@hexa:lossy.networkhexathat would be one example22:43:03
@hexa:lossy.networkhexa *
      {unit="postgresql.service"}
        |~ "ALTER DATABASE \\w+ REFRESH COLLATION VERSION"
        | regexp "DATABASE (?<database>[a-zA-Z0-9]+) REFRESH"
22:43:13
@k900:0upti.meK900Hm I should steal that 22:43:52
@hexa:lossy.networkhexa😛22:44:28
@hexa:lossy.networkhexanow I wish there was webinterface to browse the state of loki22:52:13
@hexa:lossy.networkhexanot the user facing stuff like grafana, more like what prometheus has22:52:22
@hexa:lossy.networkhexacan't say it is alerting based on that expression22:56:05
@hexa:lossy.networkhexa
[93980] WARNING:  database "template1" has a collation version mismatch
[93980] DETAIL:  The database was created using collation version 2.39, but the operating system provides version 2.40.
[93980] HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
23:00:16
@hexa:lossy.networkhexa
  rulerConfig = {
    groups = [ {
      name = "postgresql";
      rules = [ {
        alert = "PostgresqlCollationMismatch";
        expr = ''
          {unit="postgresql.service"}
            |~ 'WARNING:  database "[^"]+" has a collation version mismatch'
            | regexp 'database "(?<database>[^"]+)"'
        '';
        labels.severity = "warning";
        annotations.summary = "PostgreSQL database {{ $labels.database }} on {{ $labels.machine }}i reports database collation mismatch";
      } ];
    } ];
  };
23:01:48
@hexa:lossy.networkhexa *
  rulerConfig = {
    groups = [ {
      name = "postgresql";
      rules = [ {
        alert = "PostgresqlCollationMismatch";
        expr = ''
          {unit="postgresql.service"}
            |~ 'WARNING:  database "[^"]+" has a collation version mismatch'
            | regexp 'database "(?<database>[^"]+)"'
        '';
        labels.severity = "warning";
        annotations.summary = "PostgreSQL database {{ $labels.database }} on {{ $labels.machine }}i reports database collation mismatch";
      } ];
    } ];
  };
23:01:52
@hexa:lossy.networkhexaso for one it doesn't like single quotes 😄 23:03:24
@hexa:lossy.networkhexaand doesn't complain about it23:03:28
@hexa:lossy.networkhexa *
  rulerConfig = {
    groups = [ {
      name = "postgresql";
      rules = [ {
        alert = "PostgresqlCollationMismatch";
        expr = ''
          {unit="postgresql.service"}
            |~ "WARNING:  database \"[^\"]+\" has a collation version mismatch"
            | regexp "database \"(?<database>[^\"]+)\""
        '';
        labels.severity = "warning";
        annotations.summary = "PostgreSQL database {{ $labels.database }} on {{ $labels.machine }}i reports database collation mismatch";
      } ];
    } ];
  };
23:04:17
8 Dec 2024
@adam:robins.wtfadamcstephens My favorite, when something silently accepts invalid input 00:22:52

Show newer messages


Back to Room ListRoom Version: 10