-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: prom translation rw2 add support for labels #35751
feat: prom translation rw2 add support for labels #35751
Conversation
2073e6e
to
18665e9
Compare
18665e9
to
8165501
Compare
Signed-off-by: Juraj Michalek <[email protected]>
8165501
to
35413ab
Compare
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.
It would be awesome if we could avoid copy-pasting code, and I think it is avoidable here.
Duplicated code increases cognitive load as we need to read 200 lines of code just to understand they do exactly the same thing. Duplicated code doesn't age well as we're all flawed humans with terrible memory and eventually make a change in one place and do not on in the other.
I know this would involve quite some work because we're relying on labels built-in functions for sorting and stuff, but could we refactor it to avoid duplicated code?
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.
I really think you should try to minimize the code duplication as much as possible.
Could you take a look at my revision of your branch, where I remove the need for createAttributesV2
in the first place? I.e., I made your code work with prompb.Label
instead to be compatible with the RW v1 code.
If you duplicate all the code between RW v1 and v2 it's going to be really painful to maintain.
Thank you for the suggestion I will implement your suggested changes. |
Signed-off-by: Juraj Michalek <[email protected]>
Signed-off-by: Juraj Michalek <[email protected]>
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.
Nice work, this is looking a lot better :)
Some extra comments. 👇
Co-authored-by: Arthur Silva Sens <[email protected]>
Co-authored-by: Arthur Silva Sens <[email protected]>
Signed-off-by: Juraj Michalek <[email protected]>
Signed-off-by: Juraj Michalek <[email protected]>
Signed-off-by: Juraj Michalek <[email protected]>
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.
LGTM
Seems like CI was broken
Hopefully fixed by #35900 |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Adding full support for handling labels. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#33661 Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Juraj Michalek <[email protected]> Co-authored-by: Arthur Silva Sens <[email protected]> Co-authored-by: David Ashpole <[email protected]>
Description
Adding full support for handling labels.
Link to tracking issue #33661
Fixes
Testing
Documentation