metac icon indicating copy to clipboard operation
metac copied to clipboard

feat: display internal errors against custom resource status fields

Open AmitKumarDas opened this issue 5 years ago • 1 comments

ProblemStatement: As a DevOps engineer, I want metac to display internal errors such as RBAC failure, discovery failure, & other runtime errors that happens during reconciliation against the custom resource that was being reconciled. As of now, I have no idea if something has gone wrong unless I check the logs of metac.

Refer:

  • Comments in https://github.com/AmitKumarDas/metac/pull/143

AmitKumarDas avatar May 23 '20 07:05 AmitKumarDas

There has been several discussions to expose these errors as events & metrics. However, metac should first make this error available in a way that provides immediate help. Events & metrics will be designed & implemented eventually.

Metac can log these runtime errors against a specific field of custom resource e.g. status.metac.error In addition, this should be enabled only when the sync hook response api desires such a behaviour via a boolean field.

e.g. https://github.com/AmitKumarDas/metac/blob/master/controller/generic/hooks.go#L49

type SyncHookResponse struct {

        ....

        // this is the new boolean flag
        // if true metac will set the custom resource's status.metac.error 
        // with latest runtime error
        LogRuntimeError  bool `json:"logRuntimeError"`
}

AmitKumarDas avatar May 23 '20 07:05 AmitKumarDas