Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions source/code/plugin/in_kube_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
7 changes: 7 additions & 0 deletions source/code/plugin/in_kube_nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down