How to override metric name?

Yes, those functions are database-specific. So if you want this feature in your data source, then you will have to implement it. Here is how I did it for the Azure Monitor data source: