[Exporter.Prometheus] Use Stopwatch for scrape cache freshness check#7253
Conversation
|
I'm getting HTTP 500s from GitHub trying to post review comments, so I'm trying a PR comment instead: I think the CHANGELOG entries are overly-verbose for a user-facing note. Can you slim them down please? Also they need a link to this PR like all the other entries link to their corresponding PR. |
e0401ff to
d82ce59
Compare
|
@martincostello, thank you. Updated. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7253 +/- ##
==========================================
+ Coverage 89.88% 89.91% +0.03%
==========================================
Files 273 273
Lines 13755 13787 +32
==========================================
+ Hits 12363 12396 +33
+ Misses 1392 1391 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Thank you for your contribution @unsafePtr! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Changes
Follow-up to #7193. The scrape-response cache added in #7189 still uses
DateTime.UtcNowfor its freshness check, which can keep stale entries indefinitely on a backward NTP step or evict valid ones on a forward step. Switch toStopwatch.GetElapsedTime, matching the pattern #7193 applied elsewhere and mirroring dotnet/runtime#127303 which made the same change forEventCounter's polling timer.CollectionResponse.GeneratedAtUtcis unchanged.StopwatchExtensions.cs(added in #7193) is linked into the two Prometheus packages.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)