diff --git a/cmd/sender.go b/cmd/sender.go index 900341a..2c16251 100644 --- a/cmd/sender.go +++ b/cmd/sender.go @@ -31,7 +31,7 @@ var ( Help: "Batch size for database submissions", Buckets: []float64{1, 5, 10, 50, 100, 500, 1000, 5000, 10000}, }) - promShipperMongoSentError = promauto.NewCounterVec(prom.CounterOpts{ + promShipperDbSendError = promauto.NewCounterVec(prom.CounterOpts{ Namespace: PrometheusPrefix, // Subsystem: "shipper", Name: "insertion_error", // "errors", @@ -88,6 +88,7 @@ func (s *submitter) sender(name string, sendQueue <-chan mLog) { if !ok { return } + promShipperBatchSizeResult.Observe(float64(len(batch))) promShipperSynced.WithLabelValues(baseName).Set(0) @@ -98,6 +99,7 @@ func (s *submitter) sender(name string, sendQueue <-chan mLog) { result, err := s.db.InsertMany(mongoTimeoutCtx(context.Background()), batchBson, nil) if err != nil { + promShipperDbSendError.WithLabelValues(baseName).Add(1) s.l.Error("submission to database", zap.Error(err)) // TODO: add some selective retry here or something continue } diff --git a/cmd/submitter.go b/cmd/submitter.go index 602d0fd..1c2c0ec 100644 --- a/cmd/submitter.go +++ b/cmd/submitter.go @@ -75,7 +75,7 @@ func (s *submitter) shipFile(ctx context.Context, name string, recordLimitBytes go s.sender(name, sendChan) // TODO: better way to kill or wait for sendQueue before retrying (or duplicates?) - wait.ManagedExponentialBackoffWithContext(ctx, defaultBackoff(), func() (done bool, _ error) { + _ = wait.ManagedExponentialBackoffWithContext(ctx, defaultBackoff(), func() (done bool, _ error) { // err := s.shipFileRoutine(ctx, name, lineChan) if err == nil {