Create a plugin or extension that hooks into the alerting engine

I am interested in doing something in response to alerts being fired/resolved within Grafana. Not notifications but intercepting/duplicating/transforming the data that would eventually be written to the annotations table in the Grafana backing database.

Is this something I can do by writing a plugin?