Skip to content

Commit

Permalink
Merge pull request #149 from idealista/prepare_alertmanager_update
Browse files Browse the repository at this point in the history
Update Alert schema validation
  • Loading branch information
miguel-chacon authored Sep 16, 2019
2 parents 1aaee5d + 6506b17 commit 08e22c8
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## [Unreleased](https://github.com/idealista/prom2teams/tree/develop)
## Added
- *[#148](https://github.com/idealista/prom2teams/issues/148) Adapt template changes in Alertmanager 0.19* @miguel-chacon
## Fixed
- *[#146](https://github.com/idealista/prom2teams/issues/146) Missing 'job' label* @miguel-chacon
- *[#144](https://github.com/idealista/prom2teams/issues/144) Fix PyPI deploy* @miguel-chacon
Expand Down
1 change: 1 addition & 0 deletions prom2teams/prometheus/message_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AlertSchema(Schema):
startsAt = fields.DateTime()
endsAt = fields.DateTime()
generatorURL = fields.Str()
fingerprint = fields.Str()


class LabelSchema(Schema):
Expand Down
3 changes: 2 additions & 1 deletion tests/data/jsons/all_ok.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"startsAt": "2017-05-09T07:01:37.803000Z",
"endsAt": "2017-05-09T07:08:37.818278Z",
"generatorURL": "my.prometheusserver.url"
"generatorURL": "my.prometheusserver.url",
"fingerprint": "dd19ae3d4e06ac55"
}
],
"externalURL": "my.prometheusalertmanager.url",
Expand Down
3 changes: 2 additions & 1 deletion tests/data/jsons/all_ok_extra_labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"startsAt": "2017-05-09T07:01:37.803000Z",
"endsAt": "2017-05-09T07:08:37.818278Z",
"generatorURL": "my.prometheusserver.url"
"generatorURL": "my.prometheusserver.url",
"fingerprint": "dd19ae3d4e06ac55"
}
],
"externalURL": "my.prometheusalertmanager.url",
Expand Down
6 changes: 4 additions & 2 deletions tests/data/jsons/all_ok_multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"startsAt": "2017-05-09T07:01:37.803000000Z",
"endsAt": "2017-05-09T07:08:37.818Z",
"generatorURL": "my.prometheusserver.url"
"generatorURL": "my.prometheusserver.url",
"fingerprint": "dd19ae3d4e06ac55"
},
{
"status": "resolved",
Expand All @@ -36,7 +37,8 @@
},
"startsAt": "2017-05-09T07:01:37.803000Z",
"endsAt": "2017-05-09T07:08:37.81827Z",
"generatorURL": "my.prometheusserver.url"
"generatorURL": "my.prometheusserver.url",
"fingerprint": "dd19ae3d4e06ac55"
}
],
"externalURL": "my.prometheusalertmanager.url",
Expand Down
3 changes: 2 additions & 1 deletion tests/data/jsons/with_common_items.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
},
"startsAt": "2019-01-28T20:26:23.868893Z",
"endsAt": "2019-01-28T20:27:23.868893Z",
"generatorURL": "http://ot-mon-prometheus-operator-prometheus.monitoring:9090/graph?g0.expr=100+%2A+sum+by%28container_name%2C+pod_name%2C+namespace%29+%28increase%28container_cpu_cfs_throttled_periods_total%5B5m%5D%29%29+%2F+sum+by%28container_name%2C+pod_name%2C+namespace%29+%28increase%28container_cpu_cfs_periods_total%5B5m%5D%29%29+%3E+25\u0026g0.tab=1"
"generatorURL": "http://ot-mon-prometheus-operator-prometheus.monitoring:9090/graph?g0.expr=100+%2A+sum+by%28container_name%2C+pod_name%2C+namespace%29+%28increase%28container_cpu_cfs_throttled_periods_total%5B5m%5D%29%29+%2F+sum+by%28container_name%2C+pod_name%2C+namespace%29+%28increase%28container_cpu_cfs_periods_total%5B5m%5D%29%29+%3E+25\u0026g0.tab=1",
"fingerprint": "dd19ae3d4e06ac55"
}
],
"groupLabels": {},
Expand Down
3 changes: 2 additions & 1 deletion tests/data/jsons/without_instance_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"startsAt": "2017-05-09T07:01:37.803000Z",
"endsAt": "2017-05-09T07:08:37.818278Z",
"generatorURL": "my.prometheusserver.url"
"generatorURL": "my.prometheusserver.url",
"fingerprint": "dd19ae3d4e06ac55"
}
],
"externalURL": "my.prometheusalertmanager.url",
Expand Down
3 changes: 2 additions & 1 deletion tests/data/jsons/without_mandatory_field.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"startsAt": "2017-05-09T07:01:37.803000Z",
"endsAt": "2017-05-09T07:08:37.818278Z",
"generatorURL": "my.prometheusserver.url"
"generatorURL": "my.prometheusserver.url",
"fingerprint": "dd19ae3d4e06ac55"
}
],
"externalURL": "my.prometheusalertmanager.url",
Expand Down

0 comments on commit 08e22c8

Please sign in to comment.