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()
--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3b6a09d1-cb4b-490a-a16a-65ed9207b18d%40googlegroups.com.
Very nice view in Grafana Graph Visualisation.