<p>I am analyzing azure kubernetes service data ingestion to the log analytics and cost optimization.</p>
<p>When i analyze the logs using queries i found that container inventory produces large data ingestion to log analytics which costs more.</p>
<p>When I analyzed about container inventory for AKS, kubernetes i couldn't find proper answer.</p>
<p>Can anyone explain what is container inventory? and how it generates so much of data ingestion in aks?how can i optimize container inventory data ingestion?</p>
<p>I analyzed more about this concept but i couldn't get proper explanation about it as i fresh to azure AKS and kubernetes. can anyone guide me on this?</p>
<p>Thank you!</p>

jayaprakash R
<p>The <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/containerinventory" rel="nofollow noreferrer">ContainerIventory</a> is an inventory of all the containers running in the cluster and their properties) such as state, ports, environment variables etc).</p>
<p>The inventory is collected periodically (<a href="https://learn.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-cost#cluster-inventory" rel="nofollow noreferrer">once every minute</a>). This means that all this data is collected every minute for every container.</p>
<p>To reduce data ingestion and cost, there are a few things you can do, which are described in the <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-cost#controlling-ingestion-to-reduce-cost" rel="nofollow noreferrer">docs</a>, for example disable the environment variable collection, which can be done by either disabling log collection globally in the oms agent config map:</p>
<pre><code>[log_collection_settings.env_var]
    enabled = false
</code></pre>
<p>Or by <a href="https://learn.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-manage-agent#how-to-disable-environment-variable-collection-on-a-container" rel="nofollow noreferrer">disabling it per container</a> by setting the environment variable <code>AZMON_COLLECT_ENV</code> to false</p>
