elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
109 stars 4.93k forks source link

`metricset.name: process` is not generated for metricbeat run through docker. #41394

Open amolnater-qasource opened 1 month ago

amolnater-qasource commented 1 month ago

Kibana Build details:

VERSION: 8.16.0-BC1
BUILD: 79314
COMMIT: 5575428dd3aef69366cddb4ccf07a2a26d30ce48

Artifact: docker.elastic.co/staging/metricbeat:8.16.0-e8d5928a

Host OS: Rhel 9 and Ubuntu 24

Preconditions:

  1. 8.16.0-BC1 Kibana cloud environment should be available.
  2. Docker should be setup.

Steps to reproduce:

  1. Run below command
    sudo docker run --label co.elastic.metrics/module=system \
    --mount type=bind,source=/proc,target=/hostfs/proc,readonly \
    --mount type=bind,source=/sys/fs/cgroup,target=/hostfs/sys/fs/cgroup,readonly \
    --mount type=bind,source=/,target=/hostfs,readonly \
    --mount type=bind,source=/var/run/dbus/system_bus_socket,target=/hostfs/var/run/dbus/system_bus_socket,readonly \
    --env DBUS_SYSTEM_BUS_ADDRESS='unix:path=/hostfs/var/run/dbus/system_bus_socket' \
    --net=host --cgroupns=host docker.elastic.co/staging/metricbeat:8.16.0-e8d5928a metricbeat -e -E output.elasticsearch.hosts='https://6***************************d.com:443' \
    -E output.elasticsearch.username='elastic' \
    -E output.elasticsearch.password='******************' \
    -d '*'
  2. Observe metricbeat data is generated. However, metricset.name: process is not generated under Discover tab.
  3. Now run below command:
    sudo docker run --label co.elastic.metrics/module=system \
    --mount type=bind,source=/proc,target=/hostfs/proc,readonly \
    --mount type=bind,source=/sys/fs/cgroup,target=/hostfs/sys/fs/cgroup,readonly \
    --mount type=bind,source=/,target=/hostfs,readonly \
    --mount type=bind,source=/var/run/dbus/system_bus_socket,target=/hostfs/var/run/dbus/system_bus_socket,readonly \
    --env DBUS_SYSTEM_BUS_ADDRESS='unix:path=/hostfs/var/run/dbus/system_bus_socket' \
    --net=host docker.elastic.co/staging/metricbeat:8.16.0-e8d5928a metricbeat -e -E output.elasticsearch.hosts='https://6***************************d.com:443' \
    -E output.elasticsearch.username='elastic' \
    -E output.elasticsearch.password='******************' \
    -d '*'
  4. Still observe metricset.name: process is not generated under Discover tab.

Logs: docker-metricbeat.txt

Expected Result: metricset.name: process should be generated for metricbeat run through docker.

Screen Recording:

https://github.com/user-attachments/assets/27c5a1c8-e4e8-47ef-9288-ad9e9b87557d

Feature: https://github.com/elastic/beats/issues/39900

elasticmachine commented 1 month ago

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

amolnater-qasource commented 1 month ago

@muskangulati-qasource Please review.

muskangulati-qasource commented 1 month ago

Secondary review is Done for this ticket!

pierrehilbert commented 1 month ago

Hey @amolnater-qasource could you please confirm this is working with 8.15.3?

amolnater-qasource commented 1 month ago

Hi @pierrehilbert

Thank you for looking into this issue. We have revalidated this with docker.elastic.co/beats/metricbeat:8.15.3 and found it reproducible there too.

Further for confirmation we have tested the same with 8.15.2, 8.15.1 and 8.15.0 and had below observations:

Screen Recording:

https://github.com/user-attachments/assets/9a24e7c7-e058-4e6f-9f3d-64cfda0702b2

Please let us know if anything else is required from our end. Thanks!!

pierrehilbert commented 1 month ago

I'm looking at changes from 8.15.1 to 8.15.2 but didn't find anything for now. Maybe @cmacknz would have an idea

pierrehilbert commented 1 month ago

@amolnater-qasource what version of the system integration are you using? EDIT: forgot what I asked, you are using same stack for every agent you tested.

cmacknz commented 1 month ago

Agree, none of the commits in https://github.com/elastic/beats/compare/v8.15.1...v8.15.2 look like they should be related.

amolnater-qasource commented 1 month ago

Hi @pierrehilbert

8.16.0 metricbeat was tested on the same 8.16.0 BC1 kibana cloud environment.

For 8.15.x versions we used the same 8.15.3 kibana cloud environment. System integration v1.61.1 is available on 8.15.3.

Build details:

VERSION: 8.15.3
BUILD: 76711
COMMIT: 3933429968aafb1ba31319fc38649d0f974044bf

Please let us know if anything else is required from our end. Thanks!!

pierrehilbert commented 4 weeks ago

Hey Amol, Are you facing the same with BC2?

amolnater-qasource commented 4 weeks ago

Hi @pierrehilbert

We have revalidated this issue on rhel9 with BC2 artifact: docker.elastic.co/staging/metricbeat:8.16.0-66e9e678 and found it still reproducible:

Screen Recording:

https://github.com/user-attachments/assets/af1224a1-332f-4ed1-9721-93783d8068c4

Please let us know if anything else is required from our end. Thanks!