Grafana simplejson datasource annotations endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/annotations', methods=['POST']) | |
def annotations(): | |
req = request.get_json() | |
data = [ | |
{ | |
"annotation": 'This is the annotation', | |
"time": (convert_to_time_ms(req['range']['from']) + | |
convert_to_time_ms(req['range']['to'])) / 2, | |
"title": 'Deployment notes', | |
"tags": ['tag1', 'tag2'], | |
"text": 'Hm, something went wrong...' | |
} | |
] | |
return jsonify(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment