|
25 | 25 | FlushedMetadataSize float64 |
26 | 26 | // FlushedRecordsTimeTaken indicates the cumulative time taken to flush the records for the current period |
27 | 27 | FlushedRecordsTimeTaken float64 |
| 28 | + // NetworkFlowLogsFlushedCount indicates the number of flushed network flow logs in the current period |
| 29 | + NetworkFlowLogsFlushedCount float64 |
| 30 | + // NetworkFlowLogsFlushedSize indicates the size of the flushed network flow logs in the current period |
| 31 | + NetworkFlowLogsFlushedSize float64 |
| 32 | + // NetworkFlowLogsFlushedTimeTaken indicates the cumulative time taken to flush the network flow logs for the current period |
| 33 | + NetworkFlowLogsFlushedTimeTaken float64 |
28 | 34 | // This is telemetry for how old/latent logs we are processing in milliseconds (max over a period of time) |
29 | 35 | AgentLogProcessingMaxLatencyMs float64 |
30 | 36 | // This is telemetry for which container logs were latent (max over a period of time) |
@@ -105,6 +111,9 @@ const ( |
105 | 111 | metricNameAvgLogGenerationRate = "ContainerLogsGeneratedPerSec" |
106 | 112 | metricNameLogSize = "ContainerLogsSize" |
107 | 113 | metricNameMetadataSize = "ContainerLogsMetadataSize" |
| 114 | + metricNameNetworkFlowFlushRate = "NetworkFlowLogsAvgRecordsFlushedPerSec" |
| 115 | + metricNameNetworkFlowLogGenerationRate = "NetworkFlowLogsGeneratedPerSec" |
| 116 | + metricNameNetworkFlowLogSize = "NetworkFlowLogsSize" |
108 | 117 | metricNameAgentLogProcessingMaxLatencyMs = "ContainerLogsAgentSideLatencyMs" |
109 | 118 | metricNameNumberofTelegrafMetricsSentSuccessfully = "TelegrafMetricsSentCount" |
110 | 119 | metricNameNumberofSendErrorsTelegrafMetrics = "TelegrafMetricsSendErrorCount" |
@@ -151,6 +160,9 @@ func SendContainerLogPluginMetrics(telemetryPushIntervalProperty string) { |
151 | 160 | logRate := FlushedRecordsCount / float64(elapsed/time.Second) |
152 | 161 | logSizeRate := FlushedRecordsSize / float64(elapsed/time.Second) |
153 | 162 | metadataSizeRate := FlushedMetadataSize / float64(elapsed/time.Second) |
| 163 | + networkFlowLogsFlushedRate := NetworkFlowLogsFlushedCount / NetworkFlowLogsFlushedTimeTaken * 1000 |
| 164 | + networkFlowLogsRate := NetworkFlowLogsFlushedCount / float64(elapsed/time.Second) |
| 165 | + networkFlowLogsSizeRate := NetworkFlowLogsFlushedSize / float64(elapsed/time.Second) |
154 | 166 | telegrafMetricsSentCount := TelegrafMetricsSentCount |
155 | 167 | telegrafMetricsSendErrorCount := TelegrafMetricsSendErrorCount |
156 | 168 | telegrafMetricsSend429ErrorCount := TelegrafMetricsSend429ErrorCount |
@@ -184,6 +196,9 @@ func SendContainerLogPluginMetrics(telemetryPushIntervalProperty string) { |
184 | 196 | FlushedRecordsSize = 0.0 |
185 | 197 | FlushedMetadataSize = 0.0 |
186 | 198 | FlushedRecordsTimeTaken = 0.0 |
| 199 | + NetworkFlowLogsFlushedCount = 0.0 |
| 200 | + NetworkFlowLogsFlushedSize = 0.0 |
| 201 | + NetworkFlowLogsFlushedTimeTaken = 0.0 |
187 | 202 | logLatencyMs := AgentLogProcessingMaxLatencyMs |
188 | 203 | logLatencyMsContainer := AgentLogProcessingMaxLatencyMsContainer |
189 | 204 | AgentLogProcessingMaxLatencyMs = 0 |
@@ -315,6 +330,15 @@ func SendContainerLogPluginMetrics(telemetryPushIntervalProperty string) { |
315 | 330 | logLatencyMetric := appinsights.NewMetricTelemetry(metricNameAgentLogProcessingMaxLatencyMs, logLatencyMs) |
316 | 331 | logLatencyMetric.Properties["Container"] = logLatencyMsContainer |
317 | 332 | TelemetryClient.Track(logLatencyMetric) |
| 333 | + |
| 334 | + if IsNetworkFlowLogsEnabled { |
| 335 | + networkFlowLogsFlushedRateMetric := appinsights.NewMetricTelemetry(metricNameNetworkFlowFlushRate, networkFlowLogsFlushedRate) |
| 336 | + networkFlowLogsRateMetric := appinsights.NewMetricTelemetry(metricNameNetworkFlowLogGenerationRate, networkFlowLogsRate) |
| 337 | + networkFlowLogsSizeMetric := appinsights.NewMetricTelemetry(metricNameNetworkFlowLogSize, networkFlowLogsSizeRate) |
| 338 | + TelemetryClient.Track(networkFlowLogsFlushedRateMetric) |
| 339 | + TelemetryClient.Track(networkFlowLogsRateMetric) |
| 340 | + TelemetryClient.Track(networkFlowLogsSizeMetric) |
| 341 | + } |
318 | 342 | } |
319 | 343 | } |
320 | 344 | telegrafConfig := make(map[string]string) |
|
0 commit comments