Skip to content

Commit

Permalink
Less logging in two places (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacd authored Jun 26, 2023
1 parent bca2620 commit 5441766
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion collector/gen/exporter/otlpexporter/internal/arrow/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,23 @@ func (s *Stream) run(bgctx context.Context, streamClient StreamClientFunc, grpcO
zap.String("message", status.Message()),
)

case codes.Unavailable:
case codes.Unavailable, codes.Internal:
// gRPC returns this when max connection age is reached.
// The message string will contain NO_ERROR if it's a
// graceful shutdown.
//
// Having seen:
//
// arrow stream unknown {"kind": "exporter",
// "data_type": "traces", "name": "otlp/traces",
// "code": 13, "message": "stream terminated by
// RST_STREAM with error code: NO_ERROR"}
//
// from the default case below print `"code": 13`, this
// branch is now used for both Unavailable (witnessed
// in local testing) and Internal (witnessed in
// production); in both cases "NO_ERROR" is the key
// signifier.
if strings.Contains(status.Message(), "NO_ERROR") {
s.telemetry.Logger.Debug("arrow stream shutdown")
} else {
Expand Down
4 changes: 4 additions & 0 deletions collector/gen/receiver/otlpreceiver/internal/arrow/arrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ func (r *Receiver) logStreamError(err error) {
switch status.Code() {
case codes.Canceled:
r.telemetry.Logger.Debug("arrow stream canceled")
case codes.Unavailable:
r.telemetry.Logger.Info("arrow stream unavailable",
zap.String("message", status.Message()),
)
default:
r.telemetry.Logger.Error("arrow stream error",
zap.Uint32("code", uint32(status.Code())),
Expand Down

0 comments on commit 5441766

Please sign in to comment.