File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -453,6 +453,7 @@ func (t *Target) scrape(appender storage.SampleAppender) (err error) {
453
453
var (
454
454
samples model.Vector
455
455
numOutOfOrder int
456
+ logger = log .With ("target" , t .InstanceIdentifier ())
456
457
)
457
458
for {
458
459
if err = sdec .Decode (& samples ); err != nil {
@@ -464,14 +465,14 @@ func (t *Target) scrape(appender storage.SampleAppender) (err error) {
464
465
if err == local .ErrOutOfOrderSample {
465
466
numOutOfOrder ++
466
467
} else {
467
- log . Warnf ("Error inserting sample %v : %s" , s , err )
468
+ logger . With ( "sample" , s ). Warnf ("Error inserting sample: %s" , err )
468
469
}
469
470
}
470
471
471
472
}
472
473
}
473
474
if numOutOfOrder > 0 {
474
- log . Warnf ( " Error on ingesting %d out-of-order samples" )
475
+ logger . With ( "numDropped" , numOutOfOrder ). Warn ( " Error on ingesting out-of-order samples" )
475
476
}
476
477
477
478
if err == io .EOF {
Original file line number Diff line number Diff line change @@ -591,6 +591,7 @@ func (s *memorySeriesStorage) Append(sample *model.Sample) error {
591
591
series := s .getOrCreateSeries (fp , sample .Metric )
592
592
593
593
if sample .Timestamp <= series .lastTime {
594
+ s .fpLocker .Unlock (fp )
594
595
// Don't log and track equal timestamps, as they are a common occurrence
595
596
// when using client-side timestamps (e.g. Pushgateway or federation).
596
597
// It would be even better to also compare the sample values here, but
@@ -599,7 +600,6 @@ func (s *memorySeriesStorage) Append(sample *model.Sample) error {
599
600
s .outOfOrderSamplesCount .Inc ()
600
601
return ErrOutOfOrderSample
601
602
}
602
- s .fpLocker .Unlock (fp )
603
603
return nil
604
604
}
605
605
completedChunksCount := series .add (& model.SamplePair {
Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ type SampleAppender interface {
25
25
// of the sample after Append has returned. Remote storage
26
26
// implementation will simply drop samples if they cannot keep up with
27
27
// sending samples. Local storage implementations will only drop metrics
28
- // upon unrecoverable errors. Reporting any errors is done via metrics
29
- // and logs and not the concern of the caller.
28
+ // upon unrecoverable errors.
30
29
Append (* model.Sample ) error
31
30
// NeedsThrottling returns true if the underlying storage wishes to not
32
31
// receive any more samples. Append will still work but might lead to
You can’t perform that action at this time.
0 commit comments