# Docker.network\_summary does not take hostfs into account

**URL:** <https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677>\
**Category:** Beats\
**Tags:** docker, beats-module, metricbeat\
**Created:** [December 1, 2021, 2:10pm UTC](https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677 "2021-12-01T14:10:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julero/32/97905_2.png) [@Julero](https://discuss.elastic.co/u/Julero)\
**Post date:** [December 1, 2021, 2:10pm UTC](https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677/1 "2021-12-01T14:10:52Z")

</div>

When using docker.network\_summary, I have the following error:  
`2021-12-01T13:56:00.159Z INFO module/wrapper.go:266 Error fetching data for metricset docker.network_summary: error fetching namespace for PID 4359: error reading network namespace link: readlink /proc/4359/ns/net: no such file or directory`

PID 4359 comes from the host and is available in /hostfs mount:

```auto
sh-4.2# ll /hostfs/proc/4359/ns/net
lrwxrwxrwx. 1 root root 0 Dec 1 13:55 /hostfs/proc/4359/ns/net -> net:[4026531956]

```

I am not expert in Go but it seems like the hostfs is not taken into account into metricbeat/module/docker/network\_summary/helper.go at line 81  
My guess is that something like `nsLink, err := os.Readlink(filepath.Join(paths.Hostfs, "/proc/", fmt.Sprintf("%d", pid), "/ns/net"))` would fix the issue with the addition of "[github.com/elastic/beats/v7/libbeat/paths](http://github.com/elastic/beats/v7/libbeat/paths)" import

Should I create the issue on github ?

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [December 2, 2021, 10:01am UTC](https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677/2 "2021-12-02T10:01:41Z")

</div>

Hi @Julero!

I guess you are running Metricbeat inside a Docker container?

@Alex_Kristiansen could you verify if this is sth that we miss here?

---

<div class="post-metadata">

**Author:** ![Alex\_Kristiansen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_kristiansen/32/46086_2.png) [@Alex\_Kristiansen](https://discuss.elastic.co/u/Alex_Kristiansen)\
**Post date:** [December 3, 2021, 9:15pm UTC](https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677/3 "2021-12-03T21:15:00Z")

</div>

So, unfortunately, some metricsets don't support reading from hostfs, and network\_summary is one of them. We're working on consistently supporting an alternate hostfs across all of metricbeat.

---

<div class="post-metadata">

**Author:** ![Julero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julero/32/97905_2.png) [@Julero](https://discuss.elastic.co/u/Julero)\
**Post date:** [December 7, 2021, 9:22am UTC](https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677/4 "2021-12-07T09:22:32Z")

</div>

Yes, Metricbeat is running inside a container to monitor a GCP vm and is reporting to an Elasticsearch on a GKE cluster

I am aware that docker.network\_summary is beta as stated in the doc.

Do you think it would be fixed in the near future ?  
Should I create the issue on github or is it already included in some hostfs related feature or bug ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 4, 2022, 11:22am UTC](https://discuss.elastic.co/t/docker-network-summary-does-not-take-hostfs-into-account/290677/5 "2022-01-04T11:22:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
