Skip to content

OpsGenie integration broken in 0.6.0 #749

@Nonymus

Description

@Nonymus

When notifying opsgenie in 0.6.0, it looks like alertmanager doesn't generate valid json for the alias field anymore. See the comparison of requests captured with nc below:

v0.6.0:

POST /v1/json/alert HTTP/1.1 
Host: jposchma-dt2.lcs.intern:9090
User-Agent: Go-http-client/1.1
Content-Length: 433
Content-Type: application/json
Accept-Encoding: gzip

{"apiKey":"<redacted>","alias":"9Ԏ/\ufffd\ufffdY;ek\ufffd9\ufffd\ufffd\ufffd?    \u001e\ufffdy\ufffd\ufffdi9\u0014\ufffd\ufffd\u0011\"\ufffdC\ufffd\ufffd","message":"[FIRING:1]     TestAlert1 (page)","description":"\nAlerts Firing:\nLabels:\n - alertname = TestAlert1\n - severity = page\nAnnotations:\nSource: \n\n","details":{},"source":"http://79e37143360f:9093/#/alerts?receiver=ops-pager","teams":"ops_team"}

Notice the unicode characters and additional quotes.

v0.5.1 works fine:

POST /v1/json/alert HTTP/1.1
Host: jposchma-dt2.lcs.intern:9090
User-Agent: Go-http-client/1.1
Content-Length: 331
Content-Type: application/json
Accept-Encoding: gzip

{"apiKey":"<redacted>","alias":986256492683236487,"message":"[FIRING:1] TestAlert1 (page)","description":"\nAlerts Firing:\nLabels:\n - alertname = TestAlert1\n - severity = page\nAnnotations:\nSource: \n\n","details":{},"source":"http://9ec58373bc61:9093/#/alerts?receiver=ops-pager","teams":"ops_team"}

This leads to alerts not being shown in OpsGenie for the most part. Sometimes they do, with an unreadable alias.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions