Skip to content

Add Metadata to Alerts for Traceability and Integration #3653

@mastercactapus

Description

@mastercactapus

What problem would you like to solve? Please describe:
Difficulties in tracing and integrating with other systems due to the lack of ability to associate arbitrary metadata with an alert upon its creation and retrieval.

Describe the solution you'd like:

  • Implement a new meta in alert creation endpoints to accommodate a set of key=value pairs. This should also apply to the createAlert mutation input.
  • Create a new alert_data table for storing the new data, with an alert_id column and a data column (jsonb).
  • Update the UI to display these key-value pairs.
  • Extend Webhook notifications to include the new meta values.

Example of the Graphql input and struct formats:

input AlertMetadataInput {
  key: String!
  value: String!
}

input CreateAlertInput {
  // ...
  meta: [AlertMetadataInput!]
}

type AlertMetadata {
  key: String!
  value: String!
}

type Alert {
  // ...
  meta: [AlertMetadata!]
}
type AlertMetaValue struct {
	Key string `json:"key"`
	Value string `json:"value"`
}

const TypeAlertMetaV1 = "alert_meta_v1"

type AlertMeta struct {
	Type string `json:"type"`
	AlertMetaV1 []AlertMetaValue `alert_meta_v1`
}

Additional context:
This feature can enhance the handling of alerts to make them compatible with query parameters as well as GraphQL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions