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
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/71f66793-bf43-4b3c-b8e1-0cd76a7bfdca%40googlegroups.com.