Skip to content
Merged
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
16 changes: 8 additions & 8 deletions source/code/plugin/kubernetes_container_inventory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def getContainerInventoryRecords(podItem, batchTime, clusterCollectEnvironmentVa
end
end
rescue => error
@log.warn("KubernetesContainerInventory::getContainerInventoryRecords : Get Container Inventory Records failed: #{error}")
$log.warn("KubernetesContainerInventory::getContainerInventoryRecords : Get Container Inventory Records failed: #{error}")
$log.debug_backtrace(error.backtrace)
ApplicationInsightsUtility.sendExceptionTelemetry(error)
end
Expand Down Expand Up @@ -160,7 +160,7 @@ def getContainersInfoMap(podItem, isWindows)
end
end
rescue => error
@log.warn("KubernetesContainerInventory::getContainersInfoMap : Get Container Info Maps failed: #{error}")
$log.warn("KubernetesContainerInventory::getContainersInfoMap : Get Container Info Maps failed: #{error}")
$log.debug_backtrace(error.backtrace)
ApplicationInsightsUtility.sendExceptionTelemetry(error)
end
Expand Down Expand Up @@ -199,8 +199,8 @@ def obtainContainerEnvironmentVars(containerId)
envValueString = ["AZMON_COLLECT_ENV=FALSE"]
$log.warn("Environment Variable collection for container: #{containerId} skipped because AZMON_COLLECT_ENV is set to false")
else
# Restricting the ENV string value to 200kb since the size of this string can go very high
envVars = File.read(environFilePath, 200000)
# Restricting the ENV string value to 200kb since the size of this string can go very high
envVars = File.read(environFilePath, 200000)
if !envVars.nil? && !envVars.empty?
envVars = envVars.split("\0")
envValueString = envVars.to_s
Expand All @@ -217,10 +217,10 @@ def obtainContainerEnvironmentVars(containerId)
end
end
else
@log.warn("KubernetesContainerInventory::obtainContainerEnvironmentVars: cGroupPid is NIL or empty for containerId: #{containerId}")
$log.warn("KubernetesContainerInventory::obtainContainerEnvironmentVars: cGroupPid is NIL or empty for containerId: #{containerId}")
end
rescue => error
@log.warn("KubernetesContainerInventory::obtainContainerEnvironmentVars: obtain Container Environment vars failed: #{error} for containerId: #{containerId}")
$log.warn("KubernetesContainerInventory::obtainContainerEnvironmentVars: obtain Container Environment vars failed: #{error} for containerId: #{containerId}")
$log.debug_backtrace(error.backtrace)
ApplicationInsightsUtility.sendExceptionTelemetry(error)
end
Expand Down Expand Up @@ -299,7 +299,7 @@ def obtainWindowsContainerEnvironmentVars(pod, container)
end
end
rescue => error
@log.warn("KubernetesContainerInventory::obtainWindowsContainerEnvironmentVars: parsing of EnvVars failed: #{error}")
$log.warn("KubernetesContainerInventory::obtainWindowsContainerEnvironmentVars: parsing of EnvVars failed: #{error}")
$log.debug_backtrace(error.backtrace)
ApplicationInsightsUtility.sendExceptionTelemetry(error)
end
Expand All @@ -312,7 +312,7 @@ def deleteCGroupCacheEntryForDeletedContainer(containerId)
@@containerCGroupCache.delete(containerId)
end
rescue => error
@log.warn("KubernetesContainerInventory::deleteCGroupCacheEntryForDeletedContainer: deleting of cache entry failed: #{error}")
$log.warn("KubernetesContainerInventory::deleteCGroupCacheEntryForDeletedContainer: deleting of cache entry failed: #{error}")
$log.debug_backtrace(error.backtrace)
ApplicationInsightsUtility.sendExceptionTelemetry(error)
end
Expand Down