-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Metadata to Alerts for Traceability and Integration #3653
Comments
@mastercactapus What do you envision |
@Forfold That struct is specifically what's going to Postgres -- the idea is to have type/version info embedded in it so we have something to key off of in any migrations/changes we need to make down the line. It wouldn't be included in any of the API/external stuff, just internal |
@mastercactapus Gotcha, so the external integration wouldn't ever see this value, as it would be a hardcoded string set in the function at time of insert/update? |
@Forfold yep, exactly. Not only that, but the |
Also, a nice addition would be adding a alert(id: 123) {
id
myData: metaValue(key: "my_data_v1")
} would return: {"data": {
"alert": {
"id": 123,
"myData": "some value"
}
}} (thanks @Forfold for helping with this idea!) |
For data storage, it may be better to store as a map so that we leave open the possibility to index these (for search) in the future. Part of validation would need to ensure unique keys anyway: const TypeAlertMetaV1 = "alert_meta_v1"
type AlertMeta struct {
Type string `json:"type"`
AlertMetaV1 map[string]string `alert_meta_v1`
} |
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:
meta
in alert creation endpoints to accommodate a set ofkey=value
pairs. This should also apply to thecreateAlert
mutation input.alert_data
table for storing the new data, with analert_id
column and a data column (jsonb
).meta
values.Example of the Graphql input and struct formats:
Additional context:
This feature can enhance the handling of alerts to make them compatible with query parameters as well as GraphQL.
The text was updated successfully, but these errors were encountered: