generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Logging runtime ID and shoot name #521
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
kyma-bot
added
cla: yes
Indicates the PR's author has signed the CLA.
size/S
Denotes a PR that changes 10-29 lines, ignoring generated files.
labels
Nov 22, 2024
VOID404
changed the title
Logging runtime ID and shoot name
[WIP] Logging runtime ID and shoot name
Nov 22, 2024
kyma-bot
added
the
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress.
label
Nov 22, 2024
VOID404
changed the title
[WIP] Logging runtime ID and shoot name
Logging runtime ID and shoot name
Nov 22, 2024
kyma-bot
removed
the
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress.
label
Nov 22, 2024
VOID404
force-pushed
the
logger/id-field
branch
2 times, most recently
from
November 22, 2024 08:01
a7e62af
to
86293a9
Compare
mvshao
reviewed
Nov 22, 2024
Comment on lines
60
to
75
runtimeID, ok := runtime.Labels["kyma-project.io/runtime-id"] | ||
if !ok { | ||
runtimeID = runtime.Name | ||
} | ||
|
||
shootName, ok := runtime.Labels["kyma-project.io/shoot-name"] | ||
if !ok { | ||
shootName = "N/D" | ||
} | ||
|
||
log := r.Log.WithValues("runtime", runtimeID, "shoot", shootName) | ||
log.Info("Reconciling Runtime", "Name", runtime.Name, "Namespace", runtime.Namespace) |
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.
The overall idea is nice, and this is the correct place to implement that change. I tested it on local environment at it looks good, but I have one minor remark:
2024-11-22T12:03:04+01:00 INFO Reconciling Runtime {"runtime": "aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "shoot": "test-load", "Name": "test-ci-m5t28", "Namespace": "kcp-system"}
2024-11-22T12:03:04+01:00 INFO reqID 0 reconciliation done {"runtime": "aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "shoot": "test-load", "error": null, "result": null}
Could you change in line 70 runtime
to runtimeID
to indicate that log is printing runtimeID?
kyma-bot
added
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
and removed
size/S
Denotes a PR that changes 10-29 lines, ignoring generated files.
labels
Nov 25, 2024
VOID404
force-pushed
the
logger/id-field
branch
from
November 26, 2024 07:47
c9605a0
to
ca31351
Compare
mvshao
previously approved these changes
Nov 26, 2024
mvshao
approved these changes
Nov 26, 2024
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.
Description
Changes proposed in this pull request:
Related issue(s)