Skip to content

Commit d9b7448

Browse files
committed
Improve logging of component start errors
1 parent 8d3c19d commit d9b7448

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

service/extensions/extensions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"sort"
1111

1212
"go.uber.org/multierr"
13+
"go.uber.org/zap"
1314

1415
"go.opentelemetry.io/collector/component"
1516
"go.opentelemetry.io/collector/confmap"
@@ -46,6 +47,7 @@ func (bes *Extensions) Start(ctx context.Context, host component.Host) error {
4647
instanceID,
4748
component.NewPermanentErrorEvent(err),
4849
)
50+
extLogger.WithOptions(zap.AddStacktrace(zap.DPanicLevel)).Error("Failed to start extension", zap.Error(err))
4951
return err
5052
}
5153
bes.telemetry.Status.ReportOKIfStarting(instanceID)

service/internal/graph/graph.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"strings"
2020

2121
"go.uber.org/multierr"
22+
"go.uber.org/zap"
2223
"gonum.org/v1/gonum/graph"
2324
"gonum.org/v1/gonum/graph/simple"
2425
"gonum.org/v1/gonum/graph/topo"
@@ -423,6 +424,12 @@ func (g *Graph) StartAll(ctx context.Context, host component.Host, reporter stat
423424
instanceID,
424425
component.NewPermanentErrorEvent(compErr),
425426
)
427+
g.telemetry.Logger.WithOptions(zap.AddStacktrace(zap.DPanicLevel)).
428+
Error("Failed to start component",
429+
zap.Error(compErr),
430+
zap.String("type", instanceID.Kind.String()),
431+
zap.String("id", instanceID.ID.String()),
432+
)
426433
return compErr
427434
}
428435

0 commit comments

Comments
 (0)