Heartbeat using Docker hints

@Andrew_Cholakian1 if I use data.host in docker-compose.yml like this:

      co.elastic.monitor/1.name: "Prom"
      co.elastic.monitor/1.type: http
      co.elastic.monitor/1.hosts: "${data.host}:${data.port}"
      co.elastic.monitor/1.schedule: '@every 10s'

I get this error

Invalid interpolation format for "labels" option in service "proxy": "${data.host}:${data.port}"
Invalid interpolation format for "labels" option in service "proxy": "${data.host}:${data.port}"
Invalid interpolation format for "labels" option in service "proxy": "${data.host}:${data.port}"

Testing:

docker-compose -f docker-compose.yml config
ERROR: Invalid interpolation format for "labels" option in service "proxy": "${data.host}:${data.port}"

Per this link https://www.elastic.co/guide/en/beats/heartbeat/current/configuration-autodiscover-hints.html

example is

LABEL co.elastic.monitor/1.type=tcp co.elastic.monitor/1.hosts='${data.host}:6379' co.elastic.monitor/1.schedule='@every 10s'
LABEL co.elastic.monitor/2.type=icmp co.elastic.monitor/2.hosts='${data.host}' co.elastic.monitor/2.schedule='@every 10s'

so my example should work.

Or maybe the example from the documentation is for Dockerfile only and I am using docker-compose which creates the problem?