Last active
February 12, 2024 14:54
-
-
Save thenayr/68960e4051a90d1b3311f8ebe320e759 to your computer and use it in GitHub Desktop.
Create annotations in Grafana using Curl
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
# Curl command to create new annotation | |
curl -H "Content-Type: application/json" -X POST \ | |
-d '{"tags":["deployment","Environment"],"text":"$serviceName was deployed to $environment with commit ID $commitID"}' \ | |
http://grafana.qa.lonelyplanet.com/api/annotations | |
# Response | |
HTTP/1.1 200 | |
Content-Type: application/json | |
{"message":"Annotation added"} |
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
# Curl command to create new annotation for start of sync process | |
curl -H "Content-Type: application/json" -X POST \ | |
-d '{"tags":["sync","$environment"],"text":"$syncServiceName has started sync process"}' \ | |
http://grafana/api/annotations | |
# Response | |
HTTP/1.1 200 | |
Content-Type: application/json | |
{"message":"Annotation added"} | |
# Curl command to create new annotation for end of sync process | |
curl -H "Content-Type: application/json" -X POST \ | |
-d '{"tags":["sync","$environment"],"text":"$syncServiceName has finished sync process"}' \ | |
http://grafana/api/annotations | |
# Response | |
HTTP/1.1 200 | |
Content-Type: application/json | |
{"message":"Annotation added"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment