You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That causes the following error message in Telegraf:
2017-01-18T13:57:30Z E! ERROR in input [inputs.kubernetes]: Errors encountered: [Error parsing response: parsing time "null" as ""2006-01-02T15:04:05Z07:00"": cannot parse "null" as """]
That causes the whole kubernetes metrics to not be collected correctly if there is a single pod stopped.
The modification below has fixed it for me, but I'm not sure it is the best way of doing this:
--- a/plugins/inputs/kubernetes/kubernetes_metrics.go
+++ b/plugins/inputs/kubernetes/kubernetes_metrics.go
@@ -45,7 +45,7 @@ type CPUMetrics struct {
// PodMetrics contains metric data on a given pod
type PodMetrics struct {
PodRef PodReference `json:"podRef"`
- StartTime time.Time `json:"startTime"`
+ StartTime *time.Time `json:"startTime"`
Containers []ContainerMetrics `json:"containers"`
Network NetworkMetrics `json:"network"`
Volumes []VolumeMetrics `json:"volume"`
The text was updated successfully, but these errors were encountered:
Bug report
Using latest telegraf (built from master), kubernetes v1.2
Explanation: when a pod is stopped, the k8s API returns a null startTime for the podRef, as below:
That causes the following error message in Telegraf:
2017-01-18T13:57:30Z E! ERROR in input [inputs.kubernetes]: Errors encountered: [Error parsing response: parsing time "null" as ""2006-01-02T15:04:05Z07:00"": cannot parse "null" as """]
That causes the whole kubernetes metrics to not be collected correctly if there is a single pod stopped.
The modification below has fixed it for me, but I'm not sure it is the best way of doing this:
The text was updated successfully, but these errors were encountered: