processor

package module
v0.64.3-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 18 Imported by: 5

Documentation

Index

Constants

View Source
const UnstructuredProcessingMetricName = "datadog.logs_agent.tailer.unstructured_processing"

UnstructuredProcessingMetricName collects how many rules are used on unstructured content for tailers capable of processing both unstructured and structured content.

Variables

View Source
var JSONPayload = jsonPayload{}

JSONPayload is a shared JSON representation of a message

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode(msg *message.Message, hostname string) error
}

Encoder turns a message into a raw byte array ready to be sent.

var JSONEncoder Encoder = &jsonEncoder{}

JSONEncoder is a shared json encoder.

var JSONServerlessEncoder Encoder = &jsonServerlessEncoder{}

JSONServerlessEncoder is a shared json encoder sending a struct message field instead of a bytes message field. This encoder is used in the AWS Lambda serverless environment.

var ProtoEncoder Encoder = &protoEncoder{}

ProtoEncoder is a shared proto encoder.

var RawEncoder Encoder = &rawEncoder{}

RawEncoder is a shared raw encoder.

type Processor

type Processor struct {

	// ReconfigChan transports rules to use in order to reconfigure
	// the processing rules of the SDS Scanner.
	ReconfigChan chan sds.ReconfigureOrder
	// contains filtered or unexported fields
}

A Processor updates messages from an inputChan and pushes in an outputChan.

func New

func New(cfg pkgconfigmodel.Reader, inputChan, outputChan chan *message.Message, processingRules []*config.ProcessingRule,
	encoder Encoder, diagnosticMessageReceiver diagnostic.MessageReceiver, hostname hostnameinterface.Component,
	pipelineMonitor metrics.PipelineMonitor) *Processor

New returns an initialized Processor.

func (*Processor) Flush

func (p *Processor) Flush(ctx context.Context)

Flush processes synchronously the messages that this processor has to process. Mainly (only?) used by the Serverless Agent.

func (*Processor) GetHostname

func (p *Processor) GetHostname(msg *message.Message) string

GetHostname returns the hostname to applied the given log message

func (*Processor) Start

func (p *Processor) Start()

Start starts the Processor.

func (*Processor) Stop

func (p *Processor) Stop()

Stop stops the Processor, this call blocks until inputChan is flushed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL