fix(tasks): Add a log message for run transition clairity (#14321)
* fix(tasks): Add a log message for run transition clairity We on occasion will see a run in chronograf with missing run data. We need to find out if we are submitting incomplete data or if we submit full data and somethinge else is happeningpull/14322/head^2
parent
c40f0ec60e
commit
bf460ef4d2
|
@ -17,7 +17,7 @@ environment:
|
||||||
|
|
||||||
# Scripts that run after cloning repository
|
# Scripts that run after cloning repository
|
||||||
install:
|
install:
|
||||||
- choco install bzr # Needed to install go modules
|
# - choco install bzr # Needed to install go modules
|
||||||
- set PATH=%GOROOT%\bin;%GOPATH%\bin;C:\Program Files (x86)\Bazaar\;%PATH%
|
- set PATH=%GOROOT%\bin;%GOPATH%\bin;C:\Program Files (x86)\Bazaar\;%PATH%
|
||||||
- echo %PATH%
|
- echo %PATH%
|
||||||
- echo %GOPATH%
|
- echo %GOPATH%
|
||||||
|
|
|
@ -67,6 +67,15 @@ func (as *AnalyticalStorage) FinishRun(ctx context.Context, taskID, runID influx
|
||||||
models.NewTag([]byte(statusField), []byte(run.Status)),
|
models.NewTag([]byte(statusField), []byte(run.Status)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// log an error if we have incomplete data on finish
|
||||||
|
if !run.ID.Valid() ||
|
||||||
|
run.ScheduledFor == "" ||
|
||||||
|
run.StartedAt == "" ||
|
||||||
|
run.FinishedAt == "" ||
|
||||||
|
run.Status == "" {
|
||||||
|
as.logger.Error("Run missing critical fields", zap.String("run", fmt.Sprintf("%+v", run)), zap.String("runID", run.ID.String()))
|
||||||
|
}
|
||||||
|
|
||||||
fields := map[string]interface{}{}
|
fields := map[string]interface{}{}
|
||||||
fields[statusField] = run.Status
|
fields[statusField] = run.Status
|
||||||
fields[runIDField] = run.ID.String()
|
fields[runIDField] = run.ID.String()
|
||||||
|
|
Loading…
Reference in New Issue