Just try to group by message field in your alert query - that should be recognized as a label by Grafana automatically.