Skip to content

Commit

Permalink
fix windows perf telemetry bug (#1323)
Browse files Browse the repository at this point in the history
* fix windows perf telemetry bug

* fix formatting issue
  • Loading branch information
ganga1980 authored Sep 25, 2024
1 parent c7454e7 commit 69419d3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions source/plugins/go/input/lib/cadvisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,15 @@ func getContainerMemoryMetricItems(metricInfo map[string]interface{}, hostName,
isKubeSystemNamespace := podNamespaceLower == "kube-system"
isAmaLogsContainer := strings.HasPrefix(containerNameLower, "ama-logs")

if (isAmaLogsPod && isKubeSystemNamespace && isAmaLogsContainer && strings.EqualFold(metricName, MEMORY_RSS_BYTES) && operatingSystemLower == "linux") || (strings.EqualFold(metricName, MEMORY_WORKING_SET_BYTES) && operatingSystemLower == "windows") {
if isAmaLogsPod && isKubeSystemNamespace && isAmaLogsContainer &&
((strings.EqualFold(metricName, MEMORY_RSS_BYTES) && operatingSystemLower == "linux") ||
(strings.EqualFold(metricName, MEMORY_WORKING_SET_BYTES) && operatingSystemLower == "windows")) {
if timeDifferenceInMinutes >= TELEMETRY_FLUSH_INTERVAL_IN_MINUTES {
telemetryProps := map[string]string{}
telemetryProps["Pod"] = podName
telemetryProps["ContainerName"] = containerName
telemetryProps["Computer"] = hostName
telemetryProps := map[string]string{
"Pod": podName,
"ContainerName": containerName,
"Computer": hostName,
}
SendMetricTelemetry(metricName, metricValue, telemetryProps)
}
}
Expand Down

0 comments on commit 69419d3

Please sign in to comment.