Skip to content

Add fingerprinting for entire payloads

Sean Arnold requested to merge 214557-gitlab-alert-fingerprinting into master

What does this MR do?

This adds automatic fingerprinting for Alert Management Alerts.

This is a GitLab Premium feature.

How it works:

  1. When the user sends a payload through the API, and the user has a GitLab Premium or above license,
  2. We generate a fingerprint using the payload, excluding the start_time and hosts params (as these are often changing)
  3. If another alert is found with this fingerprint, we increment the alert count. This is the same logic as when a user provided fingerprint is provided in the payload(https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html#customizing-the-payload).

We do the following to ensure the payload fingerprint is calculated correctly:

  • Convert any nested keys into inline keys
  • Sort the inline keys, so ensure each duplicate hash generates the same SHA
  • Check to see if the hash values are are present

As this is currently behind a FF, no changelog or docs are required for this MR.

FF removal issue: #224113 (closed)

Screenshots

Alert list
Screenshot_2020-06-25_Alerts___Administrator_manual_prometheus_2_

Does this MR meet the acceptance criteria?

Conformity

Refs #214557 (closed)

Edited by Rémy Coutable

Merge request reports