You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem here is the use of %f for the second fraction. This limits the fraction to microsseconds. But higher precision is valid in RFC3339. It also rejects valid dates that do not have the fractions.
Expected behavior: prom2teams shoud accept any RFC3339 valid format for startsAt and endsAt
Actual behavior: prom2teams is trowing an exception when the second fraction is higher precision than microseconds or when there is no second fraction.
Reproduces how often: Every time one of startsAt and endsAt contains a higher precision fractions for seconds or does not contains the fractions.
Versions
python 3.6.8
alertmanager 0.17.0
prometheus 2.10.0
prom2teams 2.3.1 (installed via pip)
marshmallow 3.0.0rc6 (installed via pip as prom2teams dependecy)
The text was updated successfully, but these errors were encountered:
Is this issue resolved? I have the latest prom2teams 3.2.2 which throws the same error..
When I post the message without startsAt inthe payload Json, I get the error
curl -X POST $url -d '[{"status": "firing","labels": {"alertname": "subha-1021pm","service": "curl","severity": "critical","instance": "0"},"annotations": {"summary": "This is a summary","description": "This is a description."},"generatorURL": "http://prometheus.int.example.net/<generating_expression>"}]'
When I post it with the startsAt in the payload, I can send the message successfully.
curl -X POST $url -d '[{"status": "firing","labels": {"alertname": "subha-955pm","service": "curl","severity": "critical","instance": "0"},"annotations": {"summary": "This is a summary","description": "This is a description."},"generatorURL": "http://prometheus.int.example.net/<generating_expression>","startsAt": "2020-07-23T01:05:36+00:00"}]'
Prerequisites
Description
promt2teams is trowing the exception bellow after receiving a valid alert from alertmanager:
Steps to Reproduce
1 - Alertmanager sends an alert including valid RFC3339 dates. But the format does not conform with the validation message_schema.py:
Excerpt of a sample alert:
message_schema.py defines those fields as:
The problem here is the use of
%f
for the second fraction. This limits the fraction to microsseconds. But higher precision is valid in RFC3339. It also rejects valid dates that do not have the fractions.A quickfix is to change the fields to:
But this will accept other date formats too.
Expected behavior: prom2teams shoud accept any RFC3339 valid format for startsAt and endsAt
Actual behavior: prom2teams is trowing an exception when the second fraction is higher precision than microseconds or when there is no second fraction.
Reproduces how often: Every time one of startsAt and endsAt contains a higher precision fractions for seconds or does not contains the fractions.
Versions
python 3.6.8
alertmanager 0.17.0
prometheus 2.10.0
prom2teams 2.3.1 (installed via pip)
marshmallow 3.0.0rc6 (installed via pip as prom2teams dependecy)
The text was updated successfully, but these errors were encountered: