Hie all,
I was trying to generate alerts from a custom application which will do a POST at the alertmanager endpoint /api/v1/alerts ....
When sending alerts as a json I'm getting an error saying:
level=error ts=2020-04-15T08:48:28.224Z caller=api.go:780 component=api version=v1 msg="API error" err="bad_data: json: cannot unmarshal string into Go value of type []*types.Alert"
my alert content is (I have censored sensitive contents as ***):
alert='''[{"status": "firing", "labels": {"alertname": "InstanceDown", "instance": "localhost:9100", "job": "node", "severity": "warning"}, "annotations": {}, "startsAt": "2020-04-06T19:57:38.628106884+05:30", "endsAt": "0001-01-01T00:00:00Z", "generatorURL": "
http://adarsh-***", "fingerprint": "****"}]'''
Please help me out guys I'm not able to understand what i'm doing wrong ... as far as i've read this seems to me in correct format (without the json like representation)
thanks