rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
460 stars 261 forks source link

Add support for new receivers tied to rebased monitoring to upstream version 50.x #10838

Open gaktive opened 6 months ago

gaktive commented 6 months ago

Observability is working on https://github.com/rancher/rancher/issues/44614 to rebase monitoring to a newer upstream version; in this case 50.x.

There will be new CRDs for alerting, so UI needs to look at it as well. Details TK.

Internal reference: SURE-7884

joshmeranda commented 6 months ago

UI Differences

Here is a description of the things that would need to be chagned in in the UI, thanks for your patience!

Pod and Service Monitors

The crds for these resources have changes somewhat. I am not 100% sure how we get the initial yaml for the Create from YAML for the pod and service monitors, so let me know if / what you need from me to get those working.

Alerting Receivers

The main difference here is some new receivers. Shouldn't be anything super new, just different fields but all the same primitive types as the other receivers.

Discord

# Whether to notify about resolved alerts.
[ send_resolved: <boolean> | default = true ]

# The Discord webhook URL.
# webhook_url and webhook_url_file are mutually exclusive.
webhook_url: <secret>
webhook_url_file: <filepath>

# Message title template.
[ title: <tmpl_string> | default = '{{ template "discord.default.title" . }}' ]

# Message body template.
[ message: <tmpl_string> | default = '{{ template "discord.default.message" . }}' ]

# The HTTP client's configuration.
[ http_config: <http_config> | default = global.http_config ]

MSteams

# Whether to notify about resolved alerts.
[ send_resolved: <boolean> | default = true ]

# The incoming webhook URL.
# webhook_url and webhook_url_file are mutually exclusive.
[ webhook_url: <secret> ]
[ webhook_url_file: <filepath> ]

# Message title template.
[ title: <tmpl_string> | default = '{{ template "msteams.default.title" . }}' ]

# Message summary template.
[ summary: <tmpl_string> | default = '{{ template "msteams.default.summary" . }}' ]

# Message body template.
[ text: <tmpl_string> | default = '{{ template "msteams.default.text" . }}' ]

# The HTTP client's configuration.
[ http_config: <http_config> | default = global.http_config ]

Webex

# Whether to notify about resolved alerts.
[ send_resolved: <boolean> | default = true ]

# The Webex Teams API URL i.e. https://webexapis.com/v1/messages
# If not specified, default API URL will be used.
[ api_url: <string> | default = global.webex_api_url ]

# ID of the Webex Teams room where to send the messages.
room_id: <string>

# Message template.
[ message: <tmpl_string> default = '{{ template "webex.default.message" .}}' ]

# The HTTP client's configuration. You must use this configuration to supply the bot token as part of the HTTP `Authorization` header. 
[ http_config: <http_config> | default = global.http_config ]
gaktive commented 6 months ago

@joshmeranda is there a test build that UI can work off of? And are there example receivers for the 3 new ones to connect to?

nwmac commented 6 months ago

We may not need to make any changes - the yaml for the monitors comes from the backend, so as long as that is all good, that should "just work".

For the new alerting destinations, users can use the existing 'custom' option and provider yaml.

^ FYI @gaktive

gaktive commented 6 months ago

Cool. @nwmac is this ready for pointing then for an upcoming sprint?

nwmac commented 6 months ago

Suggestion:

joshmeranda commented 6 months ago

Sorry for the delay!

We do not have a workable test build as of now I'll let you know once we get something that could work for this. Unfortunately, we also don't have any test receivers fro you to send stuff off to.

edenhernandez-suse commented 5 months ago

Hi @joshmeranda, I'm checking the specs of the new receivers and they all have a HTTP client's configuration field. In the Webhook -> MS Teams example we currently have a SSL section and an Auth field:

image

image

Is that HTTP client's configuration related to any or both of them?

edenhernandez-suse commented 4 months ago

We want to take this opportunity to fix some issues. We should have a sub-task only for that, not sure how to link it with this one.

The designs are here: Adobe Xd Prototype

gaktive commented 1 month ago

For reference, rancher/rancher did implement something for 2.9.0 and there's a manual way to use it in the UI as commented above.