Skip to content

Instantly share code, notes, and snippets.

@benhid
Last active March 8, 2023 12:11
Show Gist options
  • Select an option

  • Save benhid/feb14535532c695ec9449df6cfa02fe0 to your computer and use it in GitHub Desktop.

Select an option

Save benhid/feb14535532c695ec9449df6cfa02fe0 to your computer and use it in GitHub Desktop.
New Relic Discord webhook payload
{
"username": "new relic",
"content": "A {{ priority }}-priority alert has been triggered. {{#if accumulations.tag.guardian }}<@{{ accumulations.tag.guardian.[0] }}> acknowledge this incident ASAP.{{/if}}",
"embeds": [
{
"title": {{ json annotations.title.[0] }},
"url": {{ json issuePageUrl }},
"description": "Check out the [runboook]({{ accumulations.runbookUrl.[0] }}) for this incident.",
"color": {{#eq state "ACTIVATED"}}16711680{{else}}15258703{{/eq}},
"fields": [
{
"name": "id",
"value": {{ json issueId }},
"inline": true
},
{
"name": "priority",
"value": {{ json priority }},
"inline": true
},
{
"name": "impactedEntities",
"value": "{{#each entitiesData.names}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"inline": true
},
{
"name": "totalIncidents",
"value": {{json totalIncidents}},
"inline": true
},
{
"name": "trigger",
"value": {{ json triggerEvent }},
"inline": true
},
{
"name": "state",
"value": {{ json state }},
"inline": true
},
{
"name": "sources",
"value": "{{#each accumulations.source}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"inline": true
},
{
"name": "alertPolicyNames",
"value": "{{#each accumulations.policyName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"inline": true
},
{
"name": "alertConditionNames",
"value": "{{#each accumulations.conditionName}}{{this}}{{#unless @last}}, {{/unless}}{{/each}}",
"inline": true
},
{
"name": "workflowName",
"value": {{ json workflowName }},
"inline": true
},
{
"name": "accumulationsTags",
"value": "{{#each accumulations.tag}}{{@key}}: [{{#each this}}'{{this}}'{{#unless @last}}, {{/unless}}{{/each}}]{{#unless @last}}, {{/unless}}{{/each}}",
"inline": false
}
],
"footer": {
"text": "Created at: {{ createdAt }}. Last updated: {{ updatedAt }}"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment