How to make 2 events from one body

Not Yet Reviewed

I got Body form Prometheus

{"receiver":"xmatters-receiver","status":"firing","alerts":[{"status":"firing","labels":{"alertname":"BOSHJobEphemeralDiskFull","bosh_deployment":"concourse","bosh_job_index":"0","bosh_job_name":"worker-pcf-backup","bosh_name":"gp2-dev-infraservices","env":"dev-gp2","environment":"dev-gp2","service":"bosh-job","severity":"critical"},"annotations":{"description":"BOSH Job `dev-gp2/gp2-dev-infraservices/concourse/worker-pcf-backup/0` has used more than 80% of its ephemeral disk for 30ms: 90%","summary":"BOSH Job `dev-gp2/gp2-dev-infraservices/concourse/worker-pcf-backup/0` is running out of ephemeral disk"},"startsAt":"2018-11-16T09:02:16.538555134Z","endsAt":"2018-11-17T09:31:16.538555134Z","generatorURL":"https://prometheus-dev.gp2.axadmin.net/graph?g0.expr=avg+by%28environment%2C+bosh_name%2C+bosh_deployment%2C+bosh_job_name%2C+bosh_job_index%29+%28bosh_job_ephemeral_disk_percent%7Bbosh_deployment%21%3D%22bosh-health-check%22%2Cbosh_job_name%21~%22%5Ecompilation.%2A%22%7D%29+%3E+80\u0026g0.tab=1"},{"status":"firing","labels":{"alertname":"BOSHJobEphemeralDiskFull","bosh_deployment":"shield-v8","bosh_job_index":"0","bosh_job_name":"dedicated_backupnode","bosh_name":"gp2-dev-infraservices","env":"dev-gp2","environment":"dev-gp2","service":"bosh-job","severity":"critical"},"annotations":{"description":"BOSH Job `dev-gp2/gp2-dev-infraservices/shield-v8/dedicated_backupnode/0` has used more than 80% of its ephemeral disk for 30ms: 96%","summary":"BOSH Job `dev-gp2/gp2-dev-infraservices/shield-v8/dedicated_backupnode/0` is running out of ephemeral disk"},"startsAt":"2018-11-15T23:02:16.538555134Z","endsAt":"2018-11-17T09:31:16.538555134Z","generatorURL":"https://prometheus-dev.gp2.axadmin.net/graph?g0.expr=avg+by%28environment%2C+bosh_name%2C+bosh_deployment%2C+bosh_job_name%2C+bosh_job_index%29+%28bosh_job_ephemeral_disk_percent%7Bbosh_deployment%21%3D%22bosh-health-check%22%2Cbosh_job_name%21~%22%5Ecompilation.%2A%22%7D%29+%3E+80\u0026g0.tab=1"}],"groupLabels":{},"commonLabels":{"alertname":"BOSHJobEphemeralDiskFull","bosh_job_index":"0","bosh_name":"gp2-dev-infraservices","env":"dev-gp2","environment":"dev-gp2","service":"bosh-job","severity":"critical"},"commonAnnotations":{},"externalURL":"https://alertmanager-dev.gp2.axadmin.net","version":"4","groupKey":"{}/{alertname=~\"^(?:BOSHJobEphemeralDiskFull)$\"}:{}"}

and Xmatters create only one Event for it with:

Prometheus Alert: 2 firing for
[FIRING:2] BOSHJobEphemeralDiskFull bosh-job(alertname = BOSHJobEphemeralDiskFull bosh_deployment = concourse bosh_job_index = 0 bosh_job_name = worker-pcf-backup bosh_name = gp2-dev-infraservices env = dev-gp2 environment = dev-gp2 service = bosh-job severity = critical )

How to make it a separate events for each Alert?

0

Comments

3 comments
Date Votes

Please sign in to leave a comment.

  • Hi Alex, that is a pretty interesting question! What exactly are you trying to accomplish by treating this in one POST request instead of sending it as two separate ones? Is that just how Prometheus provides the data? Does each alert have to go to a different recipient? Can Prometheus treat this as two separate POST requests?

    From my perspective it would be better if we get a 1:1 ratio of requests to events but a use case here of why it has to be this way would probably help us figure out a solution.

    0
  • Cross post from the github repo here

    0
  • Hi Alex,

    There hasn't been activity for some time now on this. Did the previous posts get you enough of an answer to move forward?

    0

Didn't find what you were looking for?

New post