# OKE Monitor only specific namespaces

**URL:** <https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776>\
**Category:** Container platforms\
**Tags:** kubernetes\
**Created:** [November 22, 2023, 12:08pm UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776 "2023-11-22T12:08:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![IslamEsmail](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islamesmail/32/30725_2.png) [@IslamEsmail](https://community.dynatrace.com/u/IslamEsmail)\
**Post date:** [November 22, 2023, 12:08pm UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/1 "2023-11-22T12:08:53Z")

</div>

am trying to deploy DT on specific OKE namespace and following the documentation as beloe

[Configure monitoring for namespaces and pods - Dynatrace Managed Docs](https://docs.dynatrace.com/managed/setup-and-configuration/setup-on-k8s/guides/operation/annotate#monitor-only-specific-namespaces)

and the below command is done succesfully

kubectl label namespace gitlab-runner monitor=gitlab  
namespace/gitlab-runner labeled

 ![IslamEsmail_0-1700654800303.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/3/a3b79276b7036a5132366061bb37c683c32609f5.png)

but unfortunately, DT didn’t focus on the specific namespace and start monitoring all namespaces.

any idea?

Regards,

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [November 22, 2023, 12:37pm UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/2 "2023-11-22T12:37:41Z")

</div>

Hi&nbsp;[@IslamEsmail](https://community.dynatrace.com/user/68530),

If you do not find the solution via the config files, try this via the DT GUI.

1. Create a rule do not monitor the namespaces at all.

 ![Mizs_0-1700656402520.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/a/da3aedf84ca2734adbfeca02564db0367980d7e1.png)

2. Create a rule for monitor the required namespace.

 ![Mizs_1-1700656460751.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/0/d032e7b1e67f86e23d3deeb7f9fb08ffbc4be702.png)

You can do this via API also.

 ![Mizs_3-1700656632192.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/8/082faa3eb12b940cde781d7c7ff98ac314465091.png)

I hope it helps.

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![IslamEsmail](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islamesmail/32/30725_2.png) [@IslamEsmail](https://community.dynatrace.com/u/IslamEsmail)\
**Post date:** [November 22, 2023, 3:19pm UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/3 "2023-11-22T15:19:13Z")

</div>

thanks , that something Iam going to try,

but allow me to ask is that will reflect in the page of the kubernetes namespace’s will be 1 instead of&nbsp; xxx

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [November 22, 2023, 7:55pm UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/4 "2023-11-22T19:55:44Z")

</div>

Hi&nbsp;[@IslamEsmail](https://community.dynatrace.com/user/68530),

I hope I understand you correctly.

With step1 and step2 together result is that only one gitlab namspace will be monitored.

If you need more namespaces you should repeate the step2 or change the condition operator from equals to eg. contains. (eg. you can implement a naming convention for namespaces which require deep monitoring).

Best regards,

Mizső

---

<div class="post-metadata">

**Author:** ![IslamEsmail](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islamesmail/32/30725_2.png) [@IslamEsmail](https://community.dynatrace.com/u/IslamEsmail)\
**Post date:** [November 23, 2023, 1:47pm UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/5 "2023-11-23T13:47:53Z")

</div>

Hi&nbsp;[@Mizső](https://community.dynatrace.com/user/47783)

am trying your suggested solution step by step , starting with the step number 1 applying dont monitor namespace rules and wait for awhile but nothing happened, any idea?

Regards,

---

<div class="post-metadata">

**Author:** ![IslamEsmail](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/islamesmail/32/30725_2.png) [@IslamEsmail](https://community.dynatrace.com/u/IslamEsmail)\
**Post date:** [November 27, 2023, 7:06am UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/6 "2023-11-27T07:06:49Z")

</div>

Hi&nbsp;[@Mizső](https://community.dynatrace.com/user/47783)

Am trying your approach, but it didn’t work, nothing change as monitored Kubernetes and also the license didn’t&nbsp;Decrease.

regards,

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [November 27, 2023, 9:43am UTC](https://community.dynatrace.com/t/oke-monitor-only-specific-namespaces/42776/7 "2023-11-27T09:43:47Z")

</div>

Hi&nbsp;[@IslamEsmail](https://community.dynatrace.com/user/68530),

If you use cloudNativeFullStack mode licences will not dercerase becasue the licensing worker node memory base (It does not matter which or how many namespaces are monitored. I you use&nbsp;applicationonly monitoring mode licences depend on the instrumneted pod memory limits. If you use my solution you should not see any services in the unmonitored namespaces.

I hope it helps.

Best regards,

Mizső
