See implementation in prometheus-scrape-config. The same type of functionality needs to be available in grafana agent as well, as users in this case won't be able to use the scrape-config charm to override the settings due to the principal/subordinate relationship.
It could be also implemetnted as part of cos-configuration charm, and pulled from the git as well. And this issue will unblock cos deployment on some clouds
Enhancement Proposal
See implementation in prometheus-scrape-config. The same type of functionality needs to be available in grafana agent as well, as users in this case won't be able to use the scrape-config charm to override the settings due to the principal/subordinate relationship.