Telegram

To set up sending notifications in telegram you need to:

  1. Create a telegram bot. Please note! The bot token is issued once when created via @BotFather.
  2. Determine the recipient: this can be sent to a user or to a chat group of users.

Once the bot and recipients are defined, in the GUI, configure the recipient:

  • Telegram API URL (has a default value, optional)
  • Message format: Markdown, Markdownv2, HTML (default HTML);
  • Bot token on behalf of which the notification will be sent;
  • Chat ID (individual or group). You can find out the ID by starting a dialogue in the bot from the required chat: https://t.me/userinfobot
  • Send resolved: triggers the sending of a message indicating that the alert is no longer relevant. Default: yes;
  • Disable notifications: messages will arrive without sound notification (no by default);
  • Notification template in text format. If the template is not filled out, a message will be sent using the standard operator template, for example:
An example of an alert without setting up a template

Alerts Firing: Labels:

  • alertname = example
  • alertgroup = warning
  • cluster = clustername
  • ruletype = alert
  • severity = warning Annotations:
  • description = demo
  • summary = demo Source: http://vmalert-vmalert-503055269-6467fdc88f-5srrs:8080/vmalert/alert?group_id=13440678846293985821&alert_id=946083850580454XXX

Additionally, you can customize the template directly in the template field. So, for example, to display information about the trigger date and time, severity level and description, you can use the template directly in the “Notification template in text format” field “:

Template setup example```bash {{ define "telegram.message" }} {{ if eq .Status "firing" }}🔥{{ else }}✅{{ end }} *[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}*

{{ range .Alerts }} Severity: {{ .Labels.severity | title }} Summary: {{ .Annotations.summary }} Time: {{ .StartsAt.Format “2006-01-02 15:04:05 UTC” }}

{{ if .Annotations.description }}Description: {{ .Annotations.description }} {{ end -}} {{ if .Annotations.runbook }}[Runbook]({{ .Annotations.runbook }}) {{ end -}} {{ end }} {{ end }} {{ template “telegram.message” . }}


Then the notification will look like:

<details>
<summary>Example of an alert using the template from the example above</summary>

🔥 *[FIRING] TargetDown*


*Severity:* Warning
*Summary:* One or more targets are unreachable.
*Time:* 2025-06-20 03:20:30 UTC

*Description:* 50% of the vector/ targets in logging namespace are down.

</details>

- Use TLS: yes/no (default no);

Send credentials (OPTIONAL): Username/Password pair or Bearer token.
- Username (optional field. Used for authorization paired with a password. Not required when using a Bearer token.);
- Password (optional field. Used for authorization paired with the username. Not required when using a Bearer token.);
- Bearer token (optional field. Used for authorization. Not required when using username and password);

If you need to set up a secure connection, you must additionally enter:
- Server name (required field);
- CA certificate file (required field) CAFile Certification authority certificate file in base64 format;
- Client certificate file (required field) Client certificate file in base64 format;
- Client key file (required field) Client key file in base64 format;
- Whether to disable certificate verification (no by default);

Once you've completed setting up a recipient, you need to configure what alerts will be sent on that channel. To do this, in the **Cluster/Alerts/Routes** section, configure the sending of alerts via this channel. If necessary, select notification labels that will serve as a filter for sending through a given channel.