This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Set unique labels string on prometheus metrics #136
Merged
Merged
Conversation
This file contains 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
Signed-off-by: Daniel Rammer <[email protected]>
hamersaw
requested review from
EngHabu,
katrogan,
kumare3 and
wild-endeavor
as code owners
June 7, 2022 15:17
cc @honnix |
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
==========================================
+ Coverage 68.09% 68.78% +0.68%
==========================================
Files 69 69
Lines 3401 3405 +4
==========================================
+ Hits 2316 2342 +26
+ Misses 913 904 -9
+ Partials 172 159 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
hamersaw
changed the title
Compute and set unique labels string on metrics
Set unique labels string on prometheus metrics
Jun 7, 2022
Shall we add at least one test case to cover the corruption problem? |
honnix
reviewed
Jun 7, 2022
honnix
reviewed
Jun 7, 2022
honnix
reviewed
Jun 7, 2022
EngHabu
previously approved these changes
Jun 7, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this!
Signed-off-by: Daniel Rammer <[email protected]>
Signed-off-by: Daniel Rammer <[email protected]>
Signed-off-by: Daniel Rammer <[email protected]>
Signed-off-by: Daniel Rammer <[email protected]>
Signed-off-by: Daniel Rammer <[email protected]>
Signed-off-by: Daniel Rammer <[email protected]>
honnix
approved these changes
Jun 8, 2022
Shall we get this merged and upgrade related components? |
8 tasks
EngHabu
approved these changes
Jun 9, 2022
eapolinario
pushed a commit
that referenced
this pull request
Sep 6, 2023
* computing and setting unique labels string on metrics Signed-off-by: Daniel Rammer <[email protected]> * added unit tests to counter Signed-off-by: Daniel Rammer <[email protected]> * added unit tests to gauge Signed-off-by: Daniel Rammer <[email protected]> * added unit tests to stopwatch Signed-off-by: Daniel Rammer <[email protected]> * added unit tests to summary Signed-off-by: Daniel Rammer <[email protected]> * fixed lint issue Signed-off-by: Daniel Rammer <[email protected]> * fixed another lint issue Signed-off-by: Daniel Rammer <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
TL;DR
This PR computes a unique labels set for each metric on initialization. This is used to popular metric values during increments (so a new slice does not have to be constructed), but more importantly it fixes an issue with corrupting the global metric keys slice.
Type
Are all requirements met?
Complete description
The Golang
append
function implementation will reuse the underlying slice if it has remaining capacity. In the current implementation, this means that when we construct a new metric with additional labels we may modify the global metricKeys slice. This may result in the corruption of labels within other metrics.Tracking Issue
fixes flyteorg/flyte#2597
Follow-up issue
NA