Elasticsearch, Kibana, Metricbeat based on docker compose

Hello,

I deployed Elasticsearch, Kibana, and Metricbeat containers one by one on AWS EC2.
I deployed it by referring to this guide.

It is not exactly the same, but it is mostly similar.

When you go into Kibana, this is what you see.
It recognizes the Metircbeat container as a host.

I'm curious, is it true that Elasticsearch and Kibana containers are not recognized as Hosts?
I'm new to Metricbeat, so I'm not sure if this is true.
I thought it would recognize Elasticsearch and Kibana containers as Hosts, but it wasn't.

I'm sharing the docker compose yml and metricbeat.yml that deployed Metricbeat.

Docker Compose

services:
  metricbeat01:
    image: ${METRICBEAT_IMAGE}
    user: root
    volumes:
      - /data001/metricbeat/config/certs:/usr/share/metricbeat/certs
      - /data001/metricbeat/data:/usr/share/metricbeat/data
      - "/data001/metricbeat/config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro"
      - "/proc:/hostfs/proc:ro"
      - "/:/hostfs:ro"
    environment:
      - ELASTIC_USER=elastic
      - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
      - ELASTIC_HOSTS=https://${ES01_HOSTNAME}:9200
      - KIBANA_HOSTS=http://${ES01_HOSTNAME}:5601
    extra_hosts:
      - "${ES01_HOSTNAME}=${ES01_IP}"

metircbeat.yml

metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false


metricbeat.modules:
- module: elasticsearch
  xpack.enabled: true
  period: 10s
  hosts: ${ELASTIC_HOSTS}
  ssl.certificate_authorities: "certs/ca/ca.crt"
  ssl.certificate: "certs/es01/es01.crt"
  ssl.key: "certs/es01/es01.key"
  username: ${ELASTIC_USER}
  password: ${ELASTIC_PASSWORD}
  ssl.enabled: true

- module: kibana
  metricsets:
    - stats
  period: 10s
  hosts: ${KIBANA_HOSTS}
  username: ${ELASTIC_USER}
  password: ${ELASTIC_PASSWORD}
  xpack.enabled: true


- module: docker
  metricsets:
    - "container"
    - "cpu"
    - "diskio"
    - "healthcheck"
    - "info"
    #- "image"
    - "memory"
    - "network"
  hosts: ["unix:///var/run/docker.sock"]
  period: 10s
  enabled: true


processors:
  - add_host_metadata: ~
  - add_docker_metadata: ~


output.elasticsearch:
  hosts: ${ELASTIC_HOSTS}
  username: ${ELASTIC_USER}
  password: ${ELASTIC_PASSWORD}
  ssl:
    certificate: "certs/es01/es01.crt"
    certificate_authorities: "certs/ca/ca.crt"
    key: "certs/es01/es01.key"

Thank you.