Skip to content

Create custom mapping for HTTP endpoints for alerts

Release notes

Problem to solve

To set up an alert integration, a user needs to configure alerts from a monitoring tool to match the format accepted by an incident management application. Right now, users need to configure alerts in every monitoring tool that they use to match GitLab's alert format. Some monitoring tools do not allow customization of alert formats which that means, that right now they cannot integrate these tools into GitLab.

Adding the ability to create custom mappings between an external alert and GitLab's required alert format would allow the user to:

  1. Consolidate all configuration required to integrate monitoring tools into one interface => GitLab
  2. integrate tools that do not allow customization of alert payloads

Intended users

User experience goal

Allow users to map the fields from their alerting tool to GitLab's so that their alert details populate properly in our UI.

Proposal

Designs

Mapping added to HTTP endpoint option Dropdown options Tooltip Error Final
MVC_-_Custom_selected MVC_-_Custom_selected-1 MVC_-_Custom_selected-2 MVC_-_Custom_selected-3 MVC_-_Custom_selected-4

Figma file

Technical details

Communication between Frontend and Backend (via GraphQL).

sequenceDiagram
    participant FE as Frontend
    participant BE as Backend

    FE->>+BE: Query available alert keys, payload, and stored mapping, stored sample payload
    Note left of FE: GraphQL Query
    Note right of BE: Loads and re-parses sample payload if already stored
    BE->>-FE: Available alert keys, payload to populate GitLab alert drop-downs

    FE->>+BE: Submit payload and store (optional)
    Note left of FE: GraphQL Mutation with sample payload
    Note right of BE: Stores sample payload in the database
    BE->>-FE: Available alert keys, payload to populate GitLab alert drop-downs

    FE->>+BE: `Save and trigger test alert` or `Save integration`
    Note left of FE: GraphQL Mutation
    Note right of BE: Stores custom mapping in the database
    BE->>-FE: Available alert keys, payload to populate GitLab alert drop-downs

Yellow boxes is JSON sent to/retrieved from Backend (see <details> 👇 )

GraphQL Query

WIP

  integration(gid: "gid://gitlab/...") {
    custom_mapping {
      sample_payload
      stored_mapping {
         nodes {
           gitlab_alert_field_name
           payload_alert_path
           payload_alert_fallback_path
         }
      }
      gitlab_alert_fields {
        nodes {
          name
          label
          type
          number_of_fallbacks
          compatible_types {
            nodes {
              name
            }
          }
        }
      }
      payload_alert_fields {
        nodes {
          path
          label
          type
        }
      }
    }
  }
GraphQL mutation

TODO

Further details

Permissions and Security

Documentation

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references

Edited by Peter Leitzen