Watch
2
0
Fork
You've already forked garriga
0
AlertManager → Matrix Alert Relay
  • Java 96.3%
  • Shell 2.8%
  • Dockerfile 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-31 18:42:52 +01:00
.forgejo Update workflows. 2026-07-31 18:42:52 +01:00
com.io7m.garriga.main Begin next development iteration. 2025-12-01 11:40:49 +00:00
com.io7m.garriga.oci Begin next development iteration. 2025-12-01 11:40:49 +00:00
com.io7m.garriga.tests Begin next development iteration. 2025-12-01 11:40:49 +00:00
src/site/resources Update site metadata. 2025-08-09 15:08:06 +00:00
.gitignore Initial version. 2024-06-12 18:51:29 +00:00
doc7m-books.json Add doc7m-books.json 2026-07-31 18:36:43 +01:00
pom.xml Migrate project. 2026-06-27 10:07:06 +01:00
README-CHANGES.xml Mark release 2.0.0 2025-12-01 11:40:36 +00:00
README-LICENSE.txt Update site metadata. 2025-08-09 15:08:06 +00:00
README.in Migrate project. 2026-06-27 10:07:06 +01:00
README.md Migrate project. 2026-06-27 10:07:06 +01:00

garriga

Maven Central Maven Central (snapshot) Java Version

com.io7m.garriga

garriga

An AlertManager webhook used to allow posting alert messages to a Matrix channel.

Features

OCI

OCI images are available at quay.io.

Usage

Provide a configuration file providing the various required details. For example, assume the following content in a file named config.json:

{
  "%schema": "urn:com.io7m.garriga:configuration:1",

  "HTTPServer": {
    "ListenAddress": "::",
    "ListenPort": 6000,
    "AuthenticationToken": "some-random-token-value"
  },

  "MatrixClient": {
    "BaseURI": "https://matrix.example.com",
    "User": "@alerts:matrix.example.com",
    "Password": "changeit",
    "Channel": "#alerts:matrix.example.com"
  }
}

Run garriga server --configuration-file config.json. The server will bind to all addresses, listening on port 6000, and will attempt to connect to the given Matrix server using the provided credentials. Anyone talking to the server will be required to supply an Authorization: Bearer some-random-token-value header.

WebHook

The server exposes an endpoint at /4/send that expects POST requests supplying data in the version 4 AlertManager format.

An example of a real-life message is as follows:

{
  "receiver": "matrix-webhook",
  "status": "firing",
  "alerts": [
    {
      "status": "firing",
      "labels": {
        "alertname": "HostFilesystemDeviceError",
        "device": "srv/grafana01/matrix_forwarder/etc",
        "fstype": "zfs",
        "instance": "srv.example.com:9100",
        "job": "dns-discovery",
        "mountpoint": "/srv/grafana01/matrix_forwarder/etc",
        "severity": "critical"
      },
      "annotations": {
        "description": "srv.example.com:9100: Device error with the /srv/grafana01/matrix_forwarder/etc filesystem\n  VALUE = 1\n  LABELS = map[__name__:node_filesystem_device_error device:srv/grafana01/matrix_forwarder/etc fstype:zfs instance:srv.example.com:9100 job:dns-discovery mountpoint:/srv/grafana01/matrix_forwarder/etc]",
        "summary": "Host filesystem device error (instance srv.example.com:9100)"
      },
      "startsAt": "2024-06-13T17:06:10.763Z",
      "endsAt": "0001-01-01T00:00:00Z",
      "generatorURL": "/graph?g0.expr=node_filesystem_device_error%7Bfstype%3D~%22ext2%7Cext4%7Czfs%7Cxfs%7Cvfat%22%7D+%3D%3D+1\u0026g0.tab=1",
      "fingerprint": "530731b28264424f"
    },
    {
      "status": "resolved",
      "labels": {
        "alertname": "HostSwapIsFillingUp",
        "instance": "w01.example.com:9100",
        "job": "dns-discovery",
        "nodename": "w01",
        "severity": "warning"
      },
      "annotations": {
        "description": "Swap is filling up (\u003e80%)\n  VALUE = 98.72484146349024\n  LABELS = map[instance:w01.example.com:9100 job:dns-discovery nodename:workstation01]",
        "summary": "Host swap is filling up (instance w01.example.com:9100)"
      },
      "startsAt": "2024-06-13T11:53:10.763Z",
      "endsAt": "0001-01-01T00:00:00Z",
      "generatorURL": "/graph?g0.expr=%28%281+-+%28node_memory_SwapFree_bytes+%2F+node_memory_SwapTotal_bytes%29%29+%2A+100+%3E+80%29+%2A+on+%28instance%29+group_left+%28nodename%29+node_uname_info%7Bnodename%3D~%22.%2B%22%7D\u0026g0.tab=1",
      "fingerprint": "983929006a0177d3"
    }
  ],
  "groupLabels": {},
  "commonLabels": {
    "job": "dns-discovery"
  },
  "commonAnnotations": {},
  "externalURL": "http://localhost:8080/alertmanager",
  "version": "4",
  "groupKey": "{}/{}:{}",
  "truncatedAlerts": 0
}