I don't think looking at alertmanager's internal storage is a good
solution. The formats there may change at any time.

Instead, add a webhook receiver into your alert routing tree – if you add
it at the beginning and with continue: true, you will get a copy of every
notification as a webhook. Then you can do whatever you want with it,
including putting it into your database.

/MR

On Tue, Apr 7, 2020 at 3:59 PM Adarsh Kumar Pandey <
[email protected]> wrote:

> The code is a python flask app:
> import json
> from flask import request
> from flask import Flask, redirect
> app=Flask(__name__)
> @app.route('/', methods=['GET', 'POST'])
> def index():
>     if request.method == 'POST':
>         data=request.get_json()
>         print(data)
>         with open('yourpath/alerts.json','a') as f:
>             json.dump(data,f)
>         return redirect('/')
>     else:
>         return "nothing"
> if __name__=='__main__':
>     app.run()
>
>
>
>
> On Monday, 6 April 2020 12:20:16 UTC+5:30, Adarsh Kumar Pandey wrote:
>>
>> I saw that alertmanager generates a nflog file ..I was wondering how that
>> works and can i get all the alerts fired from that log file?
>>
>> --
> 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/3b6a09d1-cb4b-490a-a16a-65ed9207b18d%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/3b6a09d1-cb4b-490a-a16a-65ed9207b18d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAMV%3D_gYt8rrSKN0BEFeW7WUd6yi3ALACMKCxdHVE2-jMmapcQg%40mail.gmail.com.

Reply via email to