# Metricbeat collect from single namespace

**URL:** <https://discuss.elastic.co/t/metricbeat-collect-from-single-namespace/166126>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 29, 2019, 9:50am UTC](https://discuss.elastic.co/t/metricbeat-collect-from-single-namespace/166126 "2019-01-29T09:50:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![remmeier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remmeier/32/40420_2.png) [@remmeier](https://discuss.elastic.co/u/remmeier)\
**Post date:** [January 29, 2019, 9:50am UTC](https://discuss.elastic.co/t/metricbeat-collect-from-single-namespace/166126/1 "2019-01-29T09:50:24Z")

</div>

Hi

Is it possible to make use of metricbeat/kubernetes to collect data from a single namespace? Background is we would like bundle it with a product to monitor itself. That product will run within a dedicated Kubernetes namespace. There are two limitations to the setup:

- Metricset is setup as regular deployment rather than deamonset (as we do not want to install on all nodes in a potentially large cluster where we only want to monitor a small piece).
- we are not allowed to hold any data other from our own namespace

But having access to kube-stats-metrics in general is fine.

Thx, Regards Remo

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [January 30, 2019, 12:51pm UTC](https://discuss.elastic.co/t/metricbeat-collect-from-single-namespace/166126/2 "2019-01-30T12:51:13Z")

</div>

Hi @remmeier and welcome 🙂

At the moment only the events metricset of the Kubernetes module can be configured to collect data only from specific namespaces. It is not possible to do it in other metricsets.

There are some options though:

- Kubernetes [autodiscover](https://www.elastic.co/guide/en/beats/metricbeat/6.6/configuration-autodiscover.html) provider can be configured for specific namespaces with the `namespace` setting, in that case only resources in this namespace are discovered. (I am checking and it seems that this setting is not documented, I'll look to add this).
- Even if events are being collected, you can drop them before being sent with the [`drop_event` processor](https://www.elastic.co/guide/en/beats/metricbeat/6.6/drop-event.html).

I hope that helps, but if none of these options work for you, feel free to [open an enhancement request](https://github.com/elastic/beats/issues/new?template=feature-request.md) explaining your use case.

---

<div class="post-metadata">

**Author:** ![remmeier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remmeier/32/40420_2.png) [@remmeier](https://discuss.elastic.co/u/remmeier)\
**Post date:** [January 31, 2019, 1:12pm UTC](https://discuss.elastic.co/t/metricbeat-collect-from-single-namespace/166126/3 "2019-01-31T13:12:18Z")

</div>

thx for this information (and in general the great product), that helps already. We will investigate a bit!

---

<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:** [February 28, 2019, 1:12pm UTC](https://discuss.elastic.co/t/metricbeat-collect-from-single-namespace/166126/4 "2019-02-28T13:12:21Z")

</div>

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