Skip to content

Commit

Permalink
Lint checks
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed May 24, 2023
1 parent e9d978f commit 3d9692e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ var MetricsTestCases = []TestCase{
},
},
{
Name: "Write ahead log enabled",
Name: "Write ahead log enabled",
OTLPInputFixturePath: "testdata/fixtures/metrics/basic_counter_metrics.json",
ExpectFixturePath: "testdata/fixtures/metrics/basic_counter_metrics_wal_expect.json",
ConfigureCollector: func(cfg *collector.Config) {
Expand Down
8 changes: 6 additions & 2 deletions exporter/collector/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ func (me *MetricsExporter) PushMetrics(ctx context.Context, m pmetric.Metrics) e
errs = append(errs, fmt.Errorf("failed to marshal protobuf to bytes: %+v", err))
continue
}
me.wal.Write(me.wWALIndex.Add(1), bytes)
err = me.wal.Write(me.wWALIndex.Add(1), bytes)
if err != nil {
errs = append(errs, fmt.Errorf("failed to write to WAL: %+v", err))
continue
}
} else {
// otherwise export directly
err := me.export(ctx, req)
Expand Down Expand Up @@ -405,7 +409,7 @@ func (me *MetricsExporter) readWALAndExport(ctx context.Context) error {
bytes, err := me.wal.Read(me.rWALIndex.Load())
if err == nil {
req := new(monitoringpb.CreateTimeSeriesRequest)
if err := proto.Unmarshal(bytes, req); err != nil {
if err = proto.Unmarshal(bytes, req); err != nil {
return err
}

Expand Down

0 comments on commit 3d9692e

Please sign in to comment.