Skip to content

Commit 09d800e

Browse files
committed
addressing review comments
1 parent 5d1fdc7 commit 09d800e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

receiver/oracledbreceiver/scraper.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ func (s *oracleScraper) scrapeLogs(ctx context.Context) (plog.Logs, error) {
540540
if topNCollectionErrors != nil {
541541
scrapeErrors = append(scrapeErrors, topNCollectionErrors)
542542
}
543+
s.lastExecutionTimestamp = currentCollectionTime
543544
}
544545
}
545546

@@ -681,7 +682,6 @@ func (s *oracleScraper) collectTopNMetricData(ctx context.Context, logs plog.Log
681682
s.logger.Debug("Log records for this scrape", zap.Int("count", hitCount))
682683
}
683684

684-
s.lastExecutionTimestamp = collectionTime
685685
s.lb.Emit(metadata.WithLogsResource(rb.Emit())).ResourceLogs().MoveAndAppendTo(logs.ResourceLogs())
686686

687687
return errors.Join(errs...)
@@ -885,7 +885,9 @@ func (s *oracleScraper) calculateLookbackSeconds() int {
885885
return int(s.topQueryCollectCfg.CollectionInterval.Seconds())
886886
}
887887

888-
const vsqlRefreshLagSec = 10 * time.Second // Buffer to account for v$sql maximum refresh latency
888+
// vsqlRefreshLagSec is the buffer to account for v$sql maximum refresh latency (5 seconds) + 5 seconds to offset any collection delays.
889+
// PS: https://docs.oracle.com/en/database/oracle/oracle-database/21/refrn/V-SQL.html
890+
const vsqlRefreshLagSec = 10 * time.Second
889891

890892
return int(math.Ceil(time.Now().
891893
Add(vsqlRefreshLagSec).

0 commit comments

Comments
 (0)