Skip to content

Commit

Permalink
Some logging improvements for LLO
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Nov 8, 2024
1 parent 340a6bf commit e1eb50e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 10 additions & 5 deletions core/services/llo/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,21 @@ func (d *dataSource) Observe(ctx context.Context, streamValues llo.StreamValues,
errStrs[i] = e.String()
failedStreamIDs[i] = e.streamID
}
d.lggr.Warnw("Observation failed for streams", "failedStreamIDs", failedStreamIDs, "errs", errStrs, "configDigest", opts.ConfigDigest(), "seqNr", opts.OutCtx().SeqNr)
successfulStreamIDs := make([]streams.StreamID, 0, len(streamValues))
for strmID := range streamValues {
successfulStreamIDs = append(successfulStreamIDs, strmID)
}
sort.Slice(successfulStreamIDs, func(i, j int) bool { return successfulStreamIDs[i] < successfulStreamIDs[j] })
d.lggr.Warnw("Observation failed for streams", "nSuccessfulStreams", len(successfulStreamIDs), "nFailedStreams", len(failedStreamIDs), "successfulStreamIDs", successfulStreamIDs, "failedStreamIDs", failedStreamIDs, "errs", errStrs, "configDigest", opts.ConfigDigest(), "seqNr", opts.OutCtx().SeqNr)
}

if opts.VerboseLogging() {
successes := make([]streams.StreamID, 0, len(streamValues))
successfulStreamIDs := make([]streams.StreamID, 0, len(streamValues))
for strmID := range streamValues {
successes = append(successes, strmID)
successfulStreamIDs = append(successfulStreamIDs, strmID)
}
sort.Slice(successes, func(i, j int) bool { return successes[i] < successes[j] })
d.lggr.Debugw("Observation complete", "successfulStreamIDs", successes, "failedStreamIDs", failedStreamIDs, "configDigest", opts.ConfigDigest(), "values", streamValues, "seqNr", opts.OutCtx().SeqNr)
sort.Slice(successfulStreamIDs, func(i, j int) bool { return successfulStreamIDs[i] < successfulStreamIDs[j] })
d.lggr.Infow("Observation complete", "successfulStreamIDs", successfulStreamIDs, "failedStreamIDs", failedStreamIDs, "configDigest", opts.ConfigDigest(), "values", streamValues, "seqNr", opts.OutCtx().SeqNr)
}

return nil
Expand Down
1 change: 0 additions & 1 deletion core/services/ocrcommon/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func ParseMercuryEATelemetry(lggr logger.Logger, trrs pipeline.TaskRunResults, f

bridgeRawResponse, ok := trr.Result.Value.(string)
if !ok {
lggr.Warnw(fmt.Sprintf("cannot get bridge response from bridge task, id=%s, name=%q, expected string got %T", trr.Task.DotID(), bridgeName, trr.Result.Value), "dotID", trr.Task.DotID(), "bridgeName", bridgeName)
continue
}
eaTelem, err := parseEATelemetry([]byte(bridgeRawResponse))
Expand Down

0 comments on commit e1eb50e

Please sign in to comment.