Skip to content

Commit a4c62c6

Browse files
authored
[Feature] Enable Operator Handler StackTraces (#1805)
1 parent df9da5c commit a4c62c6

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
- (Maintenance) Bump Go Image to 1.22.11
5353
- (Feature) Split Helm and KClient
5454
- (Bugfix) Fix ArangoRoute Target switch in case of temporary error
55+
- (Feature) Enable Operator Handler StackTraces
5556

5657
## [1.2.43](https://github.com/arangodb/kube-arangodb/tree/1.2.43) (2024-10-14)
5758
- (Feature) ArangoRoute CRD

pkg/logging/logger.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -268,6 +268,7 @@ type Logger interface {
268268
Interface(key string, i interface{}) Logger
269269
Dur(key string, dur time.Duration) Logger
270270
Time(key string, time time.Time) Logger
271+
Stack() Logger
271272

272273
Trace(msg string, args ...interface{})
273274
Debug(msg string, args ...interface{})
@@ -298,6 +299,12 @@ type chain struct {
298299
wrap Wrap
299300
}
300301

302+
func (c *chain) Stack() Logger {
303+
return c.Wrap(func(in *zerolog.Event) *zerolog.Event {
304+
return in.Stack()
305+
})
306+
}
307+
301308
func (c *chain) TraceIO() LoggerIO {
302309
return loggerIO{
303310
parent: c,

pkg/operatorV2/operator_worker.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ func (o *operator) processNextItem() bool {
7171
err := o.processObject(obj)
7272

7373
if err != nil {
74-
loggerWorker.Interface("object", obj).Error("Error during object handling: %v", err)
74+
loggerWorker.Stack().Err(err).Interface("object", obj).Error("Error during object handling: %v", err)
7575
return true
7676
}
7777

0 commit comments

Comments
 (0)