Skip to content

Commit

Permalink
keep telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
bragi92 committed Nov 5, 2021
1 parent aba4614 commit 8b5df0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/plugins/ruby/kubelet_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
rescue => errorStr
@log.error "Error in get_node_allocatable::kubereserved_cpu: #{errorStr}"
kubereserved_cpu = "0.0"
ApplicationInsightsUtility.sendExceptionTelemetry("Error in get_node_allocatable::kubereserved_cpu: #{errorStr}")
end

begin
Expand All @@ -76,6 +77,7 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
rescue => errorStr
@log.error "Error in get_node_allocatable::kubereserved_memory: #{errorStr}"
kubereserved_memory = "0.0"
ApplicationInsightsUtility.sendExceptionTelemetry("Error in get_node_allocatable::kubereserved_memory: #{errorStr}")
end
begin
systemReserved_cpu = parsed_response["kubeletconfig"]["systemReserved"]["cpu"]
Expand All @@ -87,6 +89,7 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
# this will likely always reach this condition for AKS ~ only applicable for hyrid + MDM combination
@log.error "Error in get_node_allocatable::systemReserved_cpu: #{errorStr}"
systemReserved_cpu = "0.0"
ApplicationInsightsUtility.sendExceptionTelemetry("Error in get_node_allocatable::systemReserved_cpu: #{errorStr}")
end

begin
Expand All @@ -99,6 +102,7 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
# this will likely always reach this condition for AKS ~ only applicable for hyrid + MDM combination
@log.error "Error in get_node_allocatable::explicitlyReserved_cpu: #{errorStr}"
explicitlyReserved_cpu = "0.0"
ApplicationInsightsUtility.sendExceptionTelemetry("Error in get_node_allocatable::explicitlyReserved_cpu: #{errorStr}")
end

begin
Expand All @@ -110,6 +114,7 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
rescue => errorStr
@log.error "Error in get_node_allocatable::systemReserved_memory: #{errorStr}"
systemReserved_memory = "0.0"
ApplicationInsightsUtility.sendExceptionTelemetry("Error in get_node_allocatable::systemReserved_memory: #{errorStr}")
end

begin
Expand All @@ -121,6 +126,7 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
rescue => errorStr
@log.error "Error in get_node_allocatable::evictionHard_memory: #{errorStr}"
evictionHard_memory = "0.0"
ApplicationInsightsUtility.sendExceptionTelemetry("Error in get_node_allocatable::evictionHard_memory: #{errorStr}")
end

# do calculation in nanocore since that's what KubernetesApiClient.getMetricNumericValue expects
Expand All @@ -143,7 +149,6 @@ def get_node_allocatable(cpu_capacity, memory_capacity)
@log.info "CPU Allocatable #{cpu_allocatable}"
@log.info "Memory Allocatable #{memory_allocatable}"


return [cpu_allocatable, memory_allocatable]
rescue => errorStr
@log.info "Error get_node_allocatable: #{errorStr}"
Expand Down

0 comments on commit 8b5df0a

Please sign in to comment.