Skip to content

Commit af8aa31

Browse files
authored
log failure (#6108)
1 parent a66f869 commit af8aa31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/skaffold/instrumentation/export.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ func exportMetrics(ctx context.Context, filename string, meter skaffoldMeter) er
9494
for _, m := range meters {
9595
createMetrics(ctx, m)
9696
}
97-
p.Stop(ctx)
97+
if err := p.Stop(ctx); err != nil {
98+
logrus.Debugf("error uploading metrics: %s", err)
99+
logrus.Debugf("writing to file %s instead", filename)
100+
b, _ = json.Marshal(meters)
101+
return ioutil.WriteFile(filename, b, 0666)
102+
}
98103
logrus.Debugf("metrics uploading complete in %s", time.Since(start).String())
99104

100105
if fileExists {

0 commit comments

Comments
 (0)