未验证 提交 b2e6f214 编写于 作者: P priyawadhwa 提交者: GitHub

Merge pull request #9856 from priyawadhwa/dont-fail

metrics script: don't fail if one container runtime fails
...@@ -82,7 +82,15 @@ func execute() error { ...@@ -82,7 +82,15 @@ func execute() error {
return errors.Wrap(err, "registering view") return errors.Wrap(err, "registering view")
} }
for _, cr := range []string{"docker", "containerd", "crio"} { for _, cr := range []string{"docker", "containerd", "crio"} {
sd, err := getExporter(projectID, cr) if err := exportMinikubeStart(ctx, projectID, cr); err != nil {
log.Printf("error exporting minikube start data for runtime %v: %v", cr, err)
}
}
return nil
}
func exportMinikubeStart(ctx context.Context, projectID, containerRuntime string) error {
sd, err := getExporter(projectID, containerRuntime)
if err != nil { if err != nil {
return errors.Wrap(err, "getting stackdriver exporter") return errors.Wrap(err, "getting stackdriver exporter")
} }
...@@ -93,7 +101,7 @@ func execute() error { ...@@ -93,7 +101,7 @@ func execute() error {
return errors.Wrap(err, "starting metric exporter") return errors.Wrap(err, "starting metric exporter")
} }
// track minikube start time and record it to metrics collector // track minikube start time and record it to metrics collector
st, err := minikubeStartTime(ctx, projectID, tmpFile, cr) st, err := minikubeStartTime(ctx, projectID, tmpFile, containerRuntime)
if err != nil { if err != nil {
return errors.Wrap(err, "collecting start time") return errors.Wrap(err, "collecting start time")
} }
...@@ -103,7 +111,6 @@ func execute() error { ...@@ -103,7 +111,6 @@ func execute() error {
sd.Flush() sd.Flush()
sd.StopMetricsExporter() sd.StopMetricsExporter()
trace.UnregisterExporter(sd) trace.UnregisterExporter(sd)
}
return nil return nil
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册