# Warning metricCollector (net5.0 Windows)

**URL:** <https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [August 12, 2021, 4:43pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233 "2021-08-12T16:43:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [August 12, 2021, 4:43pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/1 "2021-08-12T16:43:36Z")

</div>

Good morning,

I have a service in .NetCore 5.0 and windows (IIS) and I'm using the package of elasticAllApm and now in production I have seen the next warning:

[Warning] {"MetricsCollector"} Failed reading "CgroupMetricsProvider" 2 times: no valid samples

This message is repeating and I would like know if is possible with any option indicates that I don't want collect metrics or if I need activate something more.

Thanks for the heeelp 🙂

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [August 16, 2021, 9:40am UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/2 "2021-08-16T09:40:45Z")

</div>

Hi @Kirtash ,

yes, you can disable cgroup metrics collection.

In order to do so, you just need to add the following string to [the `DisableMetrics` setting](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-reporter.html#config-disable-metrics): `system.process.cgroup.*`. You can do this configuration similarly to any other config (like ServerUrls...).

With this you'll get rid of the warning.

---

<div class="post-metadata">

**Author:** ![shawnstrickland](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shawnstrickland/32/94055_2.png) [@shawnstrickland](https://discuss.elastic.co/u/shawnstrickland)\
**Post date:** [September 2, 2021, 3:08am UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/3 "2021-09-02T03:08:20Z")

</div>

I assume these are related to Linux cgroup?  
I initially thought there was some sort of misconfiguration with APM.  
(Got here via google)

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [September 13, 2021, 3:38pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/4 "2021-09-13T15:38:33Z")

</div>

Hi!

Nope, in my case was in windows with IIS.

Now I added this line and all works correctly and I don't have these messages

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [September 13, 2021, 3:53pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/5 "2021-09-13T15:53:08Z")

</div>

The metrics itself are related to Linux cgroup indeed, but the agent tries to query all metrics on all platforms - basically the warning just states that it's unable to get the values on Windows (no surprise...) and once the agent knows about, i'll stop querying it.

Btw. this makes me think that we could have a better logic here and for this specific metric we should skip querying it on Windows completely.

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [September 13, 2021, 8:51pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/6 "2021-09-13T20:51:11Z")

</div>

I opened a PR to improve this: [https://github.com/elastic/apm-agent-dotnet/pull/1490](https://github.com/elastic/apm-agent-dotnet/pull/1490) - with that the agent will check the OS and not try to read it on non Linux OSs.

If that makes it into a release then the disable metrics setting described above won't be needed anymore to solve this.

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [September 13, 2021, 9:34pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/7 "2021-09-13T21:34:54Z")

</div>

Thanks for all! I will follow the PR to update the nuget package version 😉

---

<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:** [October 11, 2021, 9:35pm UTC](https://discuss.elastic.co/t/warning-metriccollector-net5-0-windows/281233/8 "2021-10-11T21:35:21Z")

</div>

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