@@ -1333,7 +1333,7 @@ func (m *Manager) dropSubscriber(dropouts []string) {
1333
1333
1334
1334
// onChange is the default OnChange implementation which publishes workspace status updates to subscribers
1335
1335
func (m * Manager ) onChange (ctx context.Context , status * api.WorkspaceStatus ) {
1336
- log := log .WithFields (log .OWI (status .Metadata .Owner , status .Metadata .MetaId , status .Id ))
1336
+ clog := log .WithFields (log .OWI (status .Metadata .Owner , status .Metadata .MetaId , status .Id ))
1337
1337
1338
1338
header := make (map [string ]string )
1339
1339
span := opentracing .SpanFromContext (ctx )
@@ -1344,7 +1344,7 @@ func (m *Manager) onChange(ctx context.Context, status *api.WorkspaceStatus) {
1344
1344
// if the error was caused by the span coming from the Noop tracer - ignore it.
1345
1345
// This can happen if the workspace doesn't have a span associated with it, then we resort to creating Noop spans.
1346
1346
if _ , isNoopTracer := span .Tracer ().(opentracing.NoopTracer ); ! isNoopTracer {
1347
- log .WithError (err ).Debug ("unable to extract tracing information - trace will be broken" )
1347
+ clog .WithError (err ).Debug ("unable to extract tracing information - trace will be broken" )
1348
1348
}
1349
1349
} else {
1350
1350
for k , v := range tracingHeader {
@@ -1367,10 +1367,14 @@ func (m *Manager) onChange(ctx context.Context, status *api.WorkspaceStatus) {
1367
1367
// they represent out-of-the-ordinary situations.
1368
1368
// We attempt to use the GCP Error Reporting for this, hence log these situations as errors.
1369
1369
if status .Conditions .Failed != "" {
1370
- log .WithField ("status" , status ).Error ("workspace failed" )
1370
+ status , _ := protojson .Marshal (status )
1371
+ safeStatus , _ := log .RedactJSON (status )
1372
+ clog .WithField ("status" , safeStatus ).Error ("workspace failed" )
1371
1373
}
1372
1374
if status .Phase == 0 {
1373
- log .WithField ("status" , status ).Error ("workspace in UNKNOWN phase" )
1375
+ status , _ := protojson .Marshal (status )
1376
+ safeStatus , _ := log .RedactJSON (status )
1377
+ clog .WithField ("status" , safeStatus ).Error ("workspace in UNKNOWN phase" )
1374
1378
}
1375
1379
}
1376
1380
0 commit comments