Rename container hostname

I have Dev, Stage and Prod environments with the same setup (but different hosts, obviously) and the containers of the app are launched with the same name/hostname, so when I send logs to my log service, I cannot distinguish from which environment do the logs come.

I want to name the hostnames of the containers in a custom way. Currently the container hostname is overriden through this option in the docker-compose.yml of my Rancher setup:

labels:
   io.rancher.container.hostname_override: container_name

but changing that did not help. Any ideas how to set a custom hostname for the app container?