Docker-compose + fleet + RUM + APM on version>= 7.16

the statuscode 0 was a side issue because i forgot to mention the protocol in the RUM initialisation.

But this doesnt solve my question.

When we add an APM server to our docker-compose (see config below), it works.
However. this APM server is "legacy" according to the documentation of 7.17 and 8 and I am under the impression (after reading the docs) that fleet should be used to somehow install an agent which does the thing the legacy server did before.

So i wonder, did i miss something in my docker-compose file, or can i just press some buttons in kibana to add a fleet process, and if so, which process is going to listen to 8200 and should be mapped in the docker-compose file.

Because although kibana claims that an APM server is "running" (there is a test button and it turns green if i press it), nothing will be logged and the client will throw exceptions unless the legacy apm server is also running.

screenshot of the test button about the APM server in kibana (it shows the green message even if the legacy APM server is removed from docker-compose):

legacy server docker compose fragment:

# legacy apm server. this is deprecated.
apm-server:
  image: docker.elastic.co/apm/apm-server:7.17.1
  cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"]
  cap_drop: ["ALL"]
  ports:
    - 8200:8200
  env_file:
    - .env.apm-server
  command: >
    apm-server -e
      -E apm-server.rum.enabled=true
      -E setup.kibana.host=kibana:5601
      -E setup.template.settings.index.number_of_replicas=0
      -E apm-server.kibana.enabled=true
      -E apm-server.kibana.host=kibana:5601
      -E apm-server.kibana.username=elastic
      -E apm-server.kibana.password=............
      -E output.elasticsearch.hosts=["elastic:9200"]
      -E output.elasticsearch.username="elastic"
      -E output.elasticsearch.password=...............
      -E apm-server.rum.allow.origins=.... some domains we serve....
      -E apm-server.rum.enabled=true
  healthcheck:
    interval: 10s
    retries: 12
    test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/