We're receiving alerts from GCP through the standard webhook integration.
The payload looks like this:
{
"incident": {
...
"metric": {
"labels": {
"metric_label": "value"
}
}
"policy_user_labels": {
"policy_label": "value"
}
}
}
I want to automatically turn these labels (at least the policy ones) into alert tags. Is there a way to do so?
The "{{_payload.customField}}" syntax for alert properties doesn't seem to support nested fields.
Welcome to the Atlassian Community!
The {{_payload.customField}}
syntax in Opsgenie’s alert field mappings does not support accessing deeply nested fields like out-of-the-box.
One possible workaround would be to use GCP's alerting system to send webhooks to an intermediate Cloud Function that would:
Extract incident.policy_user_labels
Format them as a list of tags (e.g., ["policy_label:value"]
)
Send to Opsgenie with those as the tags
field directly.
Hope this suggested approach helps.
Best Regards,
Eugenio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.