logs

package
v0.0.0-...-3dd6856 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

README

logs-agent

logs-agent collects logs and submits them to datadog's infrastructure.

Structure

logs reads the config files, and instantiates what's needed. Each log line comes from a source (e.g. file, network, docker), and then enters one of the available pipeline - tailer|listener|container -> decoder -> processor -> sender -> auditor

Tailer tails a file and submits data to the processors

Listener listens on local network (TCP, UDP, Unix) and submits data to the processors

Container scans docker logs from stdout/stderr and submits data to the processors

Decoder converts bytes arrays into messages

Processor updates the messages, filtering, redacting or adding metadata, and submits to the forwarder

Sender submits the messages to the intake, and notifies the auditor

Auditor notes that messages were properly submitted, stores offsets for agent restarts

Tests

# Run the unit tests
inv test --targets=./pkg/logs --timeout=10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetScheduler

func GetScheduler() *scheduler.Scheduler

GetScheduler returns the logs-config scheduler if set.

func GetStatus

func GetStatus() status.Status

GetStatus returns logs-agent status

func IsAgentRunning

func IsAgentRunning() bool

IsAgentRunning returns true if the logs-agent is running.

func Start

func Start() error

Start starts logs-agent

func Stop

func Stop()

Stop stops properly the logs-agent to prevent data loss, it only returns when the whole pipeline is flushed.

Types

type Agent

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

Agent represents the data pipeline that collects, decodes, processes and sends logs to the backend + ------------------------------------------------------ + | | | Collector -> Decoder -> Processor -> Sender -> Auditor | | | + ------------------------------------------------------ +

func NewAgent

func NewAgent(sources *config.LogSources, services *service.Services, processingRules []*config.ProcessingRule, endpoints *client.Endpoints) *Agent

NewAgent returns a new Agent

func (*Agent) Start

func (a *Agent) Start()

Start starts all the elements of the data pipeline in the right order to prevent data loss

func (*Agent) Stop

func (a *Agent) Stop()

Stop stops all the elements of the data pipeline in the right order to prevent data loss

Directories

Path Synopsis
input
Package pb is a generated protocol buffer package.
Package pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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