AKS icon indicating copy to clipboard operation
AKS copied to clipboard

OMS: can we customise omsagent-rs-config config map?

Open ppanyukov opened this issue 6 years ago • 13 comments

We are shipping all logs from AKS to Log Analytics. This is done by OMS agents.

Since Log Analytics is priced on per-byte of ingested volume, we would like to have the OMS log volume under control so that our CFO doesn't get a heart attack after the next Azure bill :)

What are the options for tuning the log collection volums/interval with OMS agent? I am talking about things wihch end up in these tables in Log Analytics: Perf, InsightsMetrics, ContainerMetrics, KubePodInventory. On a 2-node cluster we have which is pretty much idle we have a projected 16GB per month, which equates to £22 per month which is £264 per year @ £1.32 per GB of log volume.

# Projected 30-day billable log volume based on last 24 hour period
Perf                6.363 GB
InsightsMetrics     6.198 GB
ContainerInventory  2.374 GB	
KubePodInventory    1.12 GB

I notice there is a omsagent-rs-config Config Map, which looks like exactly the thing. Among other things there I notice sections like this:

#Kubernetes pod inventory
<source>
 type kubepodinventory
 tag oms.containerinsights.KubePodInventory
 run_interval 60
 log_level debug
 custom_metrics_azure_regions eastus,southcentralus,westcentralus,westus2,southeastasia,northeurope,westeurope,southafricanorth,centralus,northcentralus,eastus2,koreacentral,eastasia,centralindia,uksouth,canadacentral,francecentral,japaneast,australiaeast
</source>

It looks like we could change run_interval from 60 to say 180 for example. Or maybe remove some things altogether.

So the questions with regards to this are:

  • Is this the right place to tweak collection volume?
  • Does this map configures all OMS logging in AKS? Is there something else?
  • Is there another, better, way to do this?
  • Is it a supported scenario for customers to customise this ConfigMap object?
  • There is a supported scenario for managing Prometheus counter scraping, which is exactly via ConfigMap object, it's just called container-azm-ms-agentconfig.

ppanyukov avatar Jul 20 '20 15:07 ppanyukov

@vishiy Can you look into this?

keikhara avatar Jul 22 '20 23:07 keikhara

@ppanyukov we don’t have a customer specific way to tune the collection frequency for all our data types, yet. We are looking to make it configurable but it has few complexities in our UX that we need to tackle. But this change is something we have been exploring and will happen soon. We are also exploring ways to lower the cost. How much do you think is acceptable cost per node per month? Do u have any inputs for us ? Thank you!

vishiy avatar Jul 23 '20 00:07 vishiy

@vishiy

How much do you think is acceptable cost per node per month? Do u have any inputs for us ?

This is a really tough question. If I asked my boss, he'd say "as little as possible, preferrably free" :) I don't know how realistic to make this part of Log Analytics part of AKS Management Plane free tier, but that obviously would be ideal from our perspective. Or maybe some shared cost model.

The main issue here is that we have clusters which are in dev, and we really don't care much for production-level monitoring levels of certain metrics, and so would like to tune down the volumes, or maybe switch off some specific metrics althogether.

Obviously it's very difficult to say what is "acceptable". People would be much happier if it was 2x cheaper than now.

Thanks for working on this and making things better! Looking forward to developments in this area.

ppanyukov avatar Jul 23 '20 10:07 ppanyukov

@Azure/aks-pm issue needs labels

ghost avatar Jul 24 '20 16:07 ghost

@vishiy any update on this? Also, I found the information that there is some "private preview" for a low-cost solution for AKS monitoring. But nobody answers emails to [email protected]. https://feedback.azure.com/forums/914020-azure-kubernetes-service-aks/suggestions/38495200-aks-has-a-high-log-analytics-cost-azure-monitor

kucher-neocles avatar Jun 10 '21 09:06 kucher-neocles

We're also looking for a way to turn down the amount of logging AKS does without having to disable Azure Monitor completely.

Ideally we'd like to lower the frequency of data pushed to the LogManagement/Perf table on a per k8s namespace level, leaving it as every minute for nodes and pods in production namespaces, but reducing it to every 3 or 5 minutes for pods in dev and staging namespaces. We'd also like to see ContainerInsights/ContainerInventory and ContainerInsights/KubePodInventory move to a change-based update model - currently over 90% of our ContainerInventory table is repeated data as it is just saying our containers remain in the running state every minute.

Are there any updates that can be shared or any current work items that are being used to track reductions/more control with azure monitor logging? (The feedback suggestion link above is now broken)

JJ11teen avatar Sep 13 '21 07:09 JJ11teen

@vishiy any updates on this?

dhlaluku avatar Nov 22 '21 10:11 dhlaluku

@keikhara @vishiy any updates on this issue?

dhlaluku avatar Dec 03 '21 02:12 dhlaluku

We are desperately waiting for some configuration possibilities as well. Log Analytics is the highest cost driver (with logs coming in through Container Insights) and got some unpleasant attention because of that. We really need to limit data ingestion in that area.

By the way: Updating omsagent-rs-config does not work. After a short period of time, the default values get restored.

Meandron avatar Feb 17 '22 10:02 Meandron

Hey @Meandron, does updating omsagent-rs-config work for the brief period of time until it is restored to its default? We could write a k8s operator to keep it fixed at the values we're after if so :)

JJ11teen avatar Apr 08 '22 03:04 JJ11teen

@JJ11teen: I really could not figure that out: Data was restored too quickly.

Meandron avatar Jun 07 '22 10:06 Meandron

Hi we are currently running our private preview to enable filtering data by frequency and namespaces.

Because this is still in preview, we require allow-listing the target subscriptions/clusters in order for this to work. Can you please fill out this form, and we will be in touch shortly.

austonli avatar Oct 18 '22 18:10 austonli

@vdiec @austonli could you provide information on what was done to allow this? Has the private preview been release?

pdefreitas avatar Nov 04 '22 11:11 pdefreitas