diff --git a/source/code/plugin/in_kube_events.rb b/source/code/plugin/in_kube_events.rb index bb0ab6f05..6f59a3fc1 100644 --- a/source/code/plugin/in_kube_events.rb +++ b/source/code/plugin/in_kube_events.rb @@ -103,8 +103,6 @@ def enumerate # Flush AppInsights telemetry once all the processing is done, only if the number of events flushed is greater than 0 if (@eventsCount > 0) - telemetryProperties = {} - telemetryProperties["CollectAllKubeEvents"] = @collectAllKubeEvents ApplicationInsightsUtility.sendMetricTelemetry("EventCount", @eventsCount, {}) end rescue => errorStr @@ -141,7 +139,7 @@ def parse_and_emit_records(events, eventQueryState, newEventQueryState, batchTim record["Name"] = items["involvedObject"]["name"] record["Reason"] = items["reason"] record["Message"] = items["message"] - record["Type"] = items["type"] + record["KubeEventType"] = items["type"] record["TimeGenerated"] = items["metadata"]["creationTimestamp"] record["SourceComponent"] = items["source"]["component"] record["FirstSeen"] = items["firstTimestamp"] diff --git a/source/code/plugin/in_kube_nodes.rb b/source/code/plugin/in_kube_nodes.rb index 4242a8dba..dcd0a0f0f 100644 --- a/source/code/plugin/in_kube_nodes.rb +++ b/source/code/plugin/in_kube_nodes.rb @@ -7,6 +7,7 @@ class Kube_nodeInventory_Input < Input @@ContainerNodeInventoryTag = "oms.containerinsights.ContainerNodeInventory" @@MDMKubeNodeInventoryTag = "mdm.kubenodeinventory" + @@configMapMountPath = "/etc/config/settings/log-data-collection-settings" @@promConfigMountPath = "/etc/config/settings/prometheus-data-collection-settings" @@AzStackCloudFileName = "/etc/kubernetes/host/azurestackcloud.json" @@kubeperfTag = "oms.api.KubePerf" @@ -18,6 +19,7 @@ class Kube_nodeInventory_Input < Input @@rsPromUrlCount = ENV["TELEMETRY_RS_PROM_URLS_LENGTH"] @@rsPromMonitorPods = ENV["TELEMETRY_RS_PROM_MONITOR_PODS"] @@rsPromMonitorPodsNamespaceLength = ENV["TELEMETRY_RS_PROM_MONITOR_PODS_NS_LENGTH"] + @@collectAllKubeEvents = ENV["AZMON_CLUSTER_COLLECT_ALL_KUBE_EVENTS"] def initialize super @@ -210,6 +212,11 @@ def parse_and_emit_records(nodeInventory, batchTime = Time.utc.iso8601) ApplicationInsightsUtility.sendExceptionTelemetry(errorStr) end + # Telemetry for data collection config for replicaset + if (File.file?(@@configMapMountPath)) + properties["collectAllKubeEvents"] = @@collectAllKubeEvents + end + #telemetry about prometheus metric collections settings for replicaset if (File.file?(@@promConfigMountPath)) properties["rsPromInt"] = @@rsPromInterval