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: 4 additions & 0 deletions source/plugins/go/src/oms.go
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ func PostDataHelper(tailPluginRecords []map[interface{}]interface{}) int {
maxLatencyContainer = name + "=" + id
}
}
} else {
ContainerLogTelemetryMutex.Lock()
ContainerLogRecordCountWithEmptyTimeStamp += 1
ContainerLogTelemetryMutex.Unlock()
}
}

Expand Down
8 changes: 8 additions & 0 deletions source/plugins/go/src/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ var (
ContainerLogsSendErrorsToADXFromFluent float64
//Tracks the number of ADX client create errors for containerlogs (uses ContainerLogTelemetryTicker)
ContainerLogsADXClientCreateErrors float64
//Tracks the number of container log records with empty Timestamp (uses ContainerLogTelemetryTicker)
ContainerLogRecordCountWithEmptyTimeStamp float64
//Tracks the number of OSM namespaces and sent only from prometheus sidecar (uses ContainerLogTelemetryTicker)
OSMNamespaceCount int
//Tracks whether monitor kubernetes pods is set to true and sent only from prometheus sidecar (uses ContainerLogTelemetryTicker)
Expand Down Expand Up @@ -82,6 +84,7 @@ const (
metricNameErrorCountKubeMonEventsMDSDClientCreateError = "KubeMonEventsMDSDClientCreateErrorsCount"
metricNameErrorCountContainerLogsSendErrorsToADXFromFluent = "ContainerLogs2ADXSendErrorCount"
metricNameErrorCountContainerLogsADXClientCreateError = "ContainerLogsADXClientCreateErrorCount"
metricNameContainerLogRecordCountWithEmptyTimeStamp = "ContainerLogRecordCountWithEmptyTimeStamp"

defaultTelemetryPushIntervalSeconds = 300

Expand Down Expand Up @@ -125,6 +128,7 @@ func SendContainerLogPluginMetrics(telemetryPushIntervalProperty string) {
promMonitorPodsNamespaceLength := PromMonitorPodsNamespaceLength
promMonitorPodsLabelSelectorLength := PromMonitorPodsLabelSelectorLength
promMonitorPodsFieldSelectorLength := PromMonitorPodsFieldSelectorLength
containerLogRecordCountWithEmptyTimeStamp := ContainerLogRecordCountWithEmptyTimeStamp

TelegrafMetricsSentCount = 0.0
TelegrafMetricsSendErrorCount = 0.0
Expand All @@ -142,6 +146,7 @@ func SendContainerLogPluginMetrics(telemetryPushIntervalProperty string) {
ContainerLogsADXClientCreateErrors = 0.0
InsightsMetricsMDSDClientCreateErrors = 0.0
KubeMonEventsMDSDClientCreateErrors = 0.0
ContainerLogRecordCountWithEmptyTimeStamp = 0.0
ContainerLogTelemetryMutex.Unlock()

if strings.Compare(strings.ToLower(os.Getenv("CONTROLLER_TYPE")), "daemonset") == 0 {
Expand Down Expand Up @@ -222,6 +227,9 @@ func SendContainerLogPluginMetrics(telemetryPushIntervalProperty string) {
if kubeMonEventsMDSDClientCreateErrors > 0.0 {
TelemetryClient.Track(appinsights.NewMetricTelemetry(metricNameErrorCountKubeMonEventsMDSDClientCreateError, kubeMonEventsMDSDClientCreateErrors))
}
if ContainerLogRecordCountWithEmptyTimeStamp > 0.0 {
TelemetryClient.Track(appinsights.NewMetricTelemetry(metricNameContainerLogRecordCountWithEmptyTimeStamp, containerLogRecordCountWithEmptyTimeStamp))
}

start = time.Now()
}
Expand Down