Is the fingerprint field in Alertmanager unique?

丶灬走出姿态 提交于 2020-08-10 17:53:26

问题


I am developing a dashboard, which receives all Alertmanager readings and processes them. I looked for a unique field in the request payload to create a unique external alert id in my database. The request payload looks something like this:

{
  "status": "firing",
  "labels": {
    "alertname": "",
    "app": "",
    "cluster": "",
    "deployed_location": "",
    "instance": "",
    "job": "",
    "kubernetes_namespace": "",
    "kubernetes_pod_name": "",
    "pod_template_hash": "",
    "release": "",
    "replica": "",
    "severity": ""
  },
  "annotations": {
    "description": "",
    "summary": ""
  },
  "startsAt": "",
  "endsAt": "",
  "generatorURL": "",
  "fingerprint": ""
}

I first used the generatorURL field, but then realized it many different alerts have the same value for generatorURL. I have been trying fingerprint, and the situation is much better. However, I am having instances where 2 to 15 alerts have the same fingerprint.

I am wondering:

  1. Is there really no unique field in Alertmanager requests?
  2. It is the nature of Alertmanager logic (or that of my alerts) that a number of alerts are created with the same fingerprint and I should just deal with it and handle it on my side, i.e. not create an incident in my DB if the given fingerprint is already used. I also worry that if I set unique=True on my alert model, some new alerts that have the same fingerprint will be missed...

来源:https://stackoverflow.com/questions/59066569/is-the-fingerprint-field-in-alertmanager-unique

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!