From e1eb50ee3e3f2a3a779414c648a7bed60a78320a Mon Sep 17 00:00:00 2001 From: Sam Davies Date: Fri, 8 Nov 2024 10:33:45 -0500 Subject: [PATCH] Some logging improvements for LLO --- core/services/llo/data_source.go | 15 ++++++++++----- core/services/ocrcommon/telemetry.go | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/services/llo/data_source.go b/core/services/llo/data_source.go index ef333f821a1..316d0685f3a 100644 --- a/core/services/llo/data_source.go +++ b/core/services/llo/data_source.go @@ -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 diff --git a/core/services/ocrcommon/telemetry.go b/core/services/ocrcommon/telemetry.go index e20b2485d86..58e57950cd3 100644 --- a/core/services/ocrcommon/telemetry.go +++ b/core/services/ocrcommon/telemetry.go @@ -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))