Implement the metrics dispose/shutdown logic#2404
Merged
cijothomas merged 5 commits intoopen-telemetry:mainfrom Sep 23, 2021
Merged
Implement the metrics dispose/shutdown logic#2404cijothomas merged 5 commits intoopen-telemetry:mainfrom
cijothomas merged 5 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2404 +/- ##
==========================================
+ Coverage 80.21% 80.26% +0.04%
==========================================
Files 232 232
Lines 7492 7500 +8
==========================================
+ Hits 6010 6020 +10
+ Misses 1482 1480 -2
|
cijothomas
reviewed
Sep 23, 2021
Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
cijothomas
reviewed
Sep 23, 2021
cijothomas
reviewed
Sep 23, 2021
| var sw = Stopwatch.StartNew(); | ||
| result = this.Collect(timeoutMilliseconds) && result; | ||
| var timeout = timeoutMilliseconds - sw.ElapsedMilliseconds; | ||
| result = this.exporter.Shutdown((int)Math.Max(timeout, 0)) && result; |
Member
There was a problem hiding this comment.
we'll need to modify PrometheusExporter to override shutdown, and shut its httpserver, right?
And obviously, for pull based exporters, any pending data is simply lost on shutdown right?
cijothomas
approved these changes
Sep 23, 2021
Member
cijothomas
left a comment
There was a problem hiding this comment.
LGTM.
PrometheusExporter need to override onshutdown to cleanup httpserver. but can be done after this
mic-max
reviewed
Sep 23, 2021
| counter.Add(1, new("name", "lemon"), new("color", "yellow")); | ||
| counter.Add(2, new("name", "apple"), new("color", "green")); | ||
| counter.Add(5, new("name", "apple"), new("color", "red")); | ||
| counter.Add(4, new("name", "lemon"), new("color", "yellow")); |
Contributor
There was a problem hiding this comment.
I like this new example topic!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #2389 merged, now we can fix the shutdown logic.
Changes