oncall-engine/engine/config_integrations
Ildar Iskhakov 7d05e6afcb
Change default source link template for alertmanager (#5005)
# What this PR does

Changing source link default template to the link to the first alert in
the group `alerts[0].generatorURL`. `externalURL` as a backlink to the
Alertmanager, is too general

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.
2024-09-11 13:24:17 +00:00
..
alertmanager.py Change default source link template for alertmanager (#5005) 2024-09-11 13:24:17 +00:00
direct_paging.py Unhide direct paging integration (#2483) 2023-07-13 13:41:31 +08:00
elastalert.py Use periodic task for heartbeats (#2723) 2023-08-10 02:25:00 +00:00
formatted_webhook.py Better english (#1959) 2023-06-01 12:37:37 +00:00
grafana.py Fix docs and UI for connecting Grafana Alerting from other stack (#4243) 2024-04-24 08:02:51 +00:00
grafana_alerting.py Change default source link template for alertmanager (#5005) 2024-09-11 13:24:17 +00:00
heartbeat.py Fix demo alert for inbound email (#2081) 2023-06-02 09:44:32 +00:00
inbound_email.py Fix demo alert for inbound email (#2081) 2023-06-02 09:44:32 +00:00
kapacitor.py Better english (#1959) 2023-06-01 12:37:37 +00:00
legacy_alertmanager.py Fix docs and UI for connecting Grafana Alerting from other stack (#4243) 2024-04-24 08:02:51 +00:00
legacy_grafana_alerting.py Fix docs and UI for connecting Grafana Alerting from other stack (#4243) 2024-04-24 08:02:51 +00:00
maintenance.py Fix demo alert for inbound email (#2081) 2023-06-02 09:44:32 +00:00
manual.py Fix demo alert for inbound email (#2081) 2023-06-02 09:44:32 +00:00
README.md add precommit rules for markdown/json files (#915) 2022-12-01 14:26:54 +01:00
slack_channel.py Fix demo alert for inbound email (#2081) 2023-06-02 09:44:32 +00:00
webhook.py Use periodic task for heartbeats (#2723) 2023-08-10 02:25:00 +00:00
zabbix.py Better english (#1959) 2023-06-01 12:37:37 +00:00

Contribute the new Integration to OnCall

Related: DEVELOPER.md

"Integration" in OnCall is a pre-configured webhook for alert consumption from alert sources. Usually, alert sources are monitoring systems such as Grafana or Zabbix.

Integration is a set of "templates" which are dumped from the integration config once the integration is created. Further changes to "templates" don't reflect on the integration config. Read more about templates here.

This instruction is supposed to help you to build templates to integrate OnCall with a new source of alerts. If you don't want to contribute to OnCall and are looking for a help integrating with custom alert source as a user, refer to this instruction.

  1. Refer to "Grafana" integration as the most complete example.
  2. Each integration should have a {{integration_name_in_snake_case}}.py file in /engine/config_integrations. There you'll find Templates that will be copied to the Integration Templates once the integration is created by the user in the OnCall UI; Example Payload; and Tests which should match the result of the rendering of Example Payload as using Templates. The best way to build such a file is to create Webhook Integration, write & debug templates in the UI first and copy-paste them to the file after.
  3. Each integration should be listed in the /engine/settings/base.py file, section INSTALLED_ONCALL_INTEGRATIONS.
  4. Each integration should have "How to connect" instruction stored as integration_{{integration_name_in_snake_case}}.html in the engine/apps/integrations/html folder. .py file has a slug field that is used to locate .html file.

What do we expect from high-quality integration?

  1. User-friendly integration instruction.
  2. Proper grouping following source's logics. If source generates multiple alerts per "detection" it would be nice to provide suitable grouping & resolving configuration in the templates.
  3. Awesome rendering. We all love when alerts look good in Slack, SMS and all other rendering destinations.