-
Notifications
You must be signed in to change notification settings - Fork 6.2k
fix(metrics): populate dest_server label (#23246) #23269
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
fix(metrics): populate dest_server label (#23246) #23269
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
Marked as draft because I need to work on the tests |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23269 +/- ##
=========================================
Coverage ? 59.96%
=========================================
Files ? 342
Lines ? 58573
Branches ? 0
=========================================
Hits ? 35125
Misses ? 20609
Partials ? 2839 ☔ View full report in Codecov by Sentry. |
bd4c240
to
2104ea2
Compare
Signed-off-by: Michael Crenshaw <[email protected]>
2104ea2
to
d4ba3dc
Compare
Signed-off-by: Michael Crenshaw <[email protected]>
@@ -40,7 +44,7 @@ metadata: | |||
spec: | |||
destination: | |||
namespace: dummy-namespace | |||
server: https://localhost:6443 | |||
name: cluster1 |
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 switched the test apps to destination name to force the logic that calculates dest_server based on name.
/cherry-pick release-3.0 |
Cherry-pick failed with |
Signed-off-by: Michael Crenshaw <[email protected]>
…3269) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: Philippe Merle <[email protected]>
…3269) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: dsuhinin <[email protected]>
…3269) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: dsuhinin <[email protected]>
#21189 simplified app controller behavior by avoiding inferring the app spec.destination.server field when not populated by the user. The refactor replaces that inference with logic that explicitly loads the destination server URL when it's needed.
The original PR missed some spots. One spot was the places where the inferred server URL was used for metrics.
This PR adds logic to populate the server URL for metrics. The costs are complexity and potential performance loss.
When encountering an error getting the server URL, I'm opting to log a warning and push the metric. I think having a metric with an unpopulated label is better than no metric at all.
Testing:
I switched the metrics tests from server-based to name-based destination, and that caused 4 metrics tests to fail, reproducing the issue. I also reproduced the issue locally with these:
The changes fix the unit tests and the manual test.
Fixes #23246