processor

package
v0.81.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package processor provides log message processing functionality

Index

Constants

View Source
const (
	// UnstructuredProcessingMetricName collects how many rules are used on unstructured
	// content for tailers capable of processing both unstructured and structured content.
	UnstructuredProcessingMetricName = "datadog.logs_agent.tailer.unstructured_processing"
)

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 JSONServerlessInitEncoder Encoder = &jsonServerlessInitEncoder{}

JSONServerlessInitEncoder is a custom encoder used by serverless-init (Google Cloud Run, Azure Container Apps, etc.) for improved performance.

var PassthroughEncoder Encoder = &passthroughEncoder{}

PassthroughEncoder is an encoder that preserves the rendered log line in GetContent() unchanged. Use this when the consumer reads GetContent() directly (e.g. the observer) to avoid wrapping the content in a JSON transport envelope.

var ProtoEncoder Encoder = &protoEncoder{}

ProtoEncoder is a shared proto encoder.

var RawEncoder Encoder = &rawEncoder{}

RawEncoder is a shared raw encoder.

func NewJSONEncoder

func NewJSONEncoder(useContainerTimestamp bool) Encoder

NewJSONEncoder returns a JSON encoder configured to optionally use container-provided timestamps.

func NewProtoEncoder

func NewProtoEncoder(useContainerTimestamp bool) Encoder

NewProtoEncoder returns a proto encoder configured to optionally use container-provided timestamps.

func NewRawEncoder

func NewRawEncoder(useContainerTimestamp bool) Encoder

NewRawEncoder returns a raw encoder configured to optionally use container-provided timestamps.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

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

func New

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

New returns an initialized Processor with config support for failover notifications.

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

type ValidUtf8Bytes

type ValidUtf8Bytes []byte

func (ValidUtf8Bytes) MarshalText

func (msg ValidUtf8Bytes) MarshalText() (text []byte, err error)

func (ValidUtf8Bytes) String

func (msg ValidUtf8Bytes) String() string

func (*ValidUtf8Bytes) UnmarshalText

func (msg *ValidUtf8Bytes) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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