We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 313cdc6 commit 5f75dddCopy full SHA for 5f75ddd
1 file changed
pkg/diagnostics/diagnostics.go
@@ -48,6 +48,8 @@ func (r *DiagnosticsRegistry) EnableServer(port int) {
48
}()
49
}
50
51
+// Registers diagnostics source callback with a given name. Name will be used as a key and callback result as a value in JSON object
52
+// during composing diagnostics JSON. Note: function will override existing diagnostics source on attempt to register another one with the same name
53
func (r *DiagnosticsRegistry) RegisterSource(name string, source func() string) {
54
r.diagnosticsMutex.Lock()
55
defer r.diagnosticsMutex.Unlock()
@@ -72,6 +74,7 @@ func (r *DiagnosticsRegistry) exposeDiagnostics() string {
72
74
73
75
bytes, err := json.Marshal(diagnostics)
76
if err != nil {
77
+ logger.Errorf("diagnostics JSON serialization error: [%v]", err)
78
return ""
79
80
0 commit comments