Skip to content

Resolve "Parse example alert payload to return list of payload alert fields"

What does this MR do?

This MR adds a GraphQL query alertManagementPayloadFields which extract alert fields from a sample payload to be used to define a custom mapping as described in &4443 (closed).

📓 Note that this code is still behind a feature flag (see #273573 (closed)).

Screenshots (strongly suggested)

GraphQL explorer
Screenshot_2021-02-01_at_14.03.22

Enable feature flag

Feature.enable(:multiple_http_integrations_custom_mapping)

Query

query Extract($fullPath: ID!, $payload: String!) {
  project(fullPath: $fullPath) {
    alertManagementPayloadFields(payloadExample: $payload) {
      path
      label
      type
    }
  }
}

Query variables

{
  "fullPath": "root/manual_prometheus", // TWEAK
  "payload": "{\"title\":\"value\",\"discarded\":23,\"started_at\":\"2020-01-02 04:05:06\",\"nested\":{\"key\":\"string\"},\"arr\":[\"one\",\"two\"]}"
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #294266 (closed)

Edited by Vitali Tatarintev

Merge request reports