Fixed problem with zero pod creation time
@@ -175,13 +175,18 @@ func (sink *StackdriverSink) ExportData(dataBatch *core.DataBatch) {
sink.lastExportTime = dataBatch.Timestamp
req := getReq()
- for _, metricSet := range dataBatch.MetricSets {
+ for key, metricSet := range dataBatch.MetricSets {
switch metricSet.Labels["type"] {
case core.MetricSetTypeNode, core.MetricSetTypePod, core.MetricSetTypePodContainer, core.MetricSetTypeSystemContainer:
default:
continue
}
+ if metricSet.CreateTime.IsZero() {
+ glog.V(2).Infof("Skipping incorrect metric set %s because create time is zero", key)
+ continue
+ }
+
if metricSet.Labels["type"] == core.MetricSetTypeNode {
metricSet.Labels[core.LabelContainerName.Key] = "machine"
}
