-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AMLII-2249 - fortify log tailer pipeline for journald and windows events
Pass the specified tailers through a no-op line handler, as the messages these tailers produce are not viable candidates for truncation. Develop and use a new NoopDecoder constructor to make it clear that these entities do not yet have meaningful work being performed on them in the decoder flow.
- Loading branch information
Showing
4 changed files
with
73 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2024-present Datadog, Inc. | ||
|
||
package decoder | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/DataDog/datadog-agent/pkg/logs/message" | ||
) | ||
|
||
// NoopLineHandler provides a passthrough functionality for flows that don't need a functional line handler | ||
type NoopLineHandler struct { | ||
outputChan chan *message.Message | ||
} | ||
|
||
// NewNoopLineHandler returns a new NoopLineHandler | ||
func NewNoopLineHandler(outputChan chan *message.Message) *NoopLineHandler { | ||
return &NoopLineHandler{outputChan: outputChan} | ||
} | ||
|
||
// process handles a new line (message) | ||
func (noop *NoopLineHandler) process(msg *message.Message) { | ||
noop.outputChan <- msg | ||
} | ||
|
||
// flushChan returns a channel which will deliver a message when `flush` should be called. | ||
func (noop *NoopLineHandler) flushChan() <-chan time.Time { | ||
return nil | ||
} | ||
|
||
// flush flushes partially-processed data. It should be called either when flushChan has | ||
// a message, or when the decoder is stopped. | ||
func (noop *NoopLineHandler) flush() { | ||
|
||
} |
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