-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: return partial reports without failure (#45)
- Loading branch information
Showing
9 changed files
with
219 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package forwarders | ||
|
||
import ( | ||
"github.com/kong/kubernetes-telemetry/pkg/types" | ||
) | ||
|
||
type rawChannelForwarder struct { | ||
ch chan types.Report | ||
} | ||
|
||
// NewRawChannelForwarder creates new rawChannelForwarder. | ||
func NewRawChannelForwarder(ch chan types.Report) *rawChannelForwarder { | ||
return &rawChannelForwarder{ | ||
ch: ch, | ||
} | ||
} | ||
|
||
func (f *rawChannelForwarder) Name() string { | ||
return "LogForwarder" | ||
} | ||
|
||
func (f *rawChannelForwarder) Forward(r types.Report) error { | ||
f.ch <- r | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package log | ||
|
||
import "github.com/sirupsen/logrus" | ||
|
||
// TODO: Address logging levels and library to be used. | ||
// See: https://github.com/Kong/kubernetes-ingress-controller/issues/1893 | ||
const ( | ||
logrusrDiff = 4 | ||
|
||
// InfoLevel is the converted logging level from logrus to go-logr for | ||
// information level logging. Note that the logrusr middleware technically | ||
// flattens all levels prior to this level into this level as well. | ||
InfoLevel = int(logrus.InfoLevel) - logrusrDiff | ||
|
||
// DebugLevel is the converted logging level from logrus to go-logr for | ||
// debug level logging. | ||
DebugLevel = int(logrus.DebugLevel) - logrusrDiff | ||
|
||
// WarnLevel is the converted logrus level to go-logr for warnings. | ||
WarnLevel = int(logrus.WarnLevel) - logrusrDiff | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.