-
Notifications
You must be signed in to change notification settings - Fork 236
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: add optional logging for expander stages #2162
feat: add optional logging for expander stages #2162
Conversation
dd67398
to
095ffd2
Compare
experiments/compositions/composition/internal/controller/expander_reconciler.go
Outdated
Show resolved
Hide resolved
...s/compositions/composition/tests/data/TestSimpleCompositionExpanderLoggingEnabled/input.yaml
Outdated
Show resolved
Hide resolved
095ffd2
to
c1cad1e
Compare
experiments/compositions/composition/internal/controller/expander_reconciler.go
Outdated
Show resolved
Hide resolved
34b77f9
to
b64a07a
Compare
experiments/compositions/composition/internal/controller/expander_reconciler.go
Outdated
Show resolved
Hide resolved
experiments/compositions/composition/internal/controller/expander_reconciler.go
Outdated
Show resolved
Hide resolved
b64a07a
to
baf56d1
Compare
4a4e006
to
970d833
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.
/approve
/lgtm
@@ -517,6 +540,10 @@ func (r *ExpanderReconciler) evaluateAndSavePlan(ctx context.Context, logger log | |||
err = fmt.Errorf("Evaluate Failed: %s", result.Error.Message) | |||
return values, updated, "EvaluateStatusFailed", err | |||
} | |||
if expanderDebugLogEnabled { | |||
logger.Info(expanderDebugLog(cr) + fmt.Sprintf("---sent expander request: %v, received results: %v", evaluateRequest, result)) | |||
r.Recorder.Event(cr, "Normal", fmt.Sprintf("Expander stage %s evaluation completed", expander.Name), expanderDebugLog(cr)+fmt.Sprintf("---request: %v, result: %v", evaluateRequest, result)) |
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.
Not sure if there is a limit on what can be sent to an event. Nevertheless lets try it.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: barney-s The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8331376
into
GoogleCloudPlatform:master
This PR adds the option to enable logging for each expander stage for better debug ability.
Log message start with
expanderDebugLog---${Kind}/${Namespace}/${Name}---version: ${Version}
Example log: