Skip to content

Add Matrix Notifier#600

Closed
bbigras wants to merge 1 commit intoprometheus:masterfrom
bbigras:matrix
Closed

Add Matrix Notifier#600
bbigras wants to merge 1 commit intoprometheus:masterfrom
bbigras:matrix

Conversation

@bbigras
Copy link
Contributor

@bbigras bbigras commented Jan 10, 2017

If I understand Matrix correctly, when you send an HTML message, you also send a plain text version so it can be shown in notifications and maybe to clients without HTML support.

I'm wondering if you find the default HTML message too complicated for the configuration page:

{{ define "matrix.default.html" }}<a href="{{ template "__alertmanagerURL" . }}"><font color="{{ if eq .Status "firing" }}red{{ else }}green{{ end }}"><b>{{ template "__subject" . }}</b></font></a>{{ end }}

A room id looks like !AAffRRJHDD:matrix.org so I used used room_id: !<something>:matrix.org in the simple.yml but maybe there's a better way.

Matrix support should allow to be able to change the server (i.e. matrix.org) but I'm thinking about doing it in the next PR.

@bbigras
Copy link
Contributor Author

bbigras commented Jan 13, 2017

@fabxc

- name: 'matrix'
matrix_configs:
- access_token: <access_token>
room_id: !<something>:matrix.org
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to make this not tied to matrix.org homeserver? I would like to use this with my homeserver without having to federate a room to matrix.org

data = n.tmpl.Data(receiverName(ctx), groupLabels(ctx), as...)
tmplText = tmplText(n.tmpl, data, &err)
tmplHTML = tmplHTML(n.tmpl, data, &err)
url = fmt.Sprintf("https://matrix.org/_matrix/client/r0/rooms/%s/send/m.room.message/m%d.1?access_token=%s", n.conf.RoomID, time.Now().Unix(), n.conf.AccessToken)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with rrix, URL of Matrix Homeserver should be configurable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants