Skip to content

Commit

Permalink
prometheusremotewrite: wal default nop-logger
Browse files Browse the repository at this point in the history
Initializes the WAL with a default nop logger, instead of previous nil
which led to panics.
  • Loading branch information
sh0rez committed Jun 5, 2023
1 parent 45fa20d commit 9dedddd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions exporter/prometheusremotewriteexporter/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func newWAL(walConfig *WALConfig, exportSink func(context.Context, []*prompb.Wri
rNotify: make(chan struct{}),
rWALIndex: &atomic.Uint64{},
wWALIndex: &atomic.Uint64{},
log: zap.NewNop(),
}

return &wal, nil
Expand Down
1 change: 1 addition & 0 deletions exporter/prometheusremotewriteexporter/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func TestWAL_persist(t *testing.T) {

pwal, err := newWAL(config, doNothingExportSink)
require.Nil(t, err)
pwal.log = zap.Must(zap.NewDevelopment())

// 1. Write out all the entries.
reqL := []*prompb.WriteRequest{
Expand Down

0 comments on commit 9dedddd

Please sign in to comment.