Skip to content

Instantly share code, notes, and snippets.

@thenayr
Last active February 12, 2024 14:54
Show Gist options
  • Save thenayr/68960e4051a90d1b3311f8ebe320e759 to your computer and use it in GitHub Desktop.
Save thenayr/68960e4051a90d1b3311f8ebe320e759 to your computer and use it in GitHub Desktop.
Create annotations in Grafana using Curl
# 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"}
# 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