How to create alias on Grafana group by values

As title, please check my question on stackoverflow:

https://stackoverflow.com/questions/50013372/how-to-create-alias-on-grafana-group-by-values