pilot

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILEBEAT_EXEC_CMD  = "/usr/bin/filebeat"
	FILEBEAT_REGISTRY  = "/var/lib/filebeat/registry"
	FILEBEAT_BASE_CONF = "/etc/filebeat"
	FILEBEAT_CONF_DIR  = FILEBEAT_BASE_CONF + "/prospectors.d"
	FILEBEAT_CONF_FILE = FILEBEAT_BASE_CONF + "/filebeat.yml"

	DOCKER_SYSTEM_PATH  = "/var/lib/docker/"
	KUBELET_SYSTEM_PATH = "/var/lib/kubelet/"

	ENV_FILEBEAT_OUTPUT = "FILEBEAT_OUTPUT"
)
View Source
const (
	FLUENTD_EXEC_CMD  = "/usr/bin/fluentd"
	FLUENTD_BASE_CONF = "/etc/fluentd"
	FLUENTD_CONF_DIR  = FLUENTD_BASE_CONF + "/conf.d"
	FLUENTD_CONF_FILE = FLUENTD_BASE_CONF + "/fluentd.conf"
	FLUENTD_PLUGINS   = FLUENTD_BASE_CONF + "/plugins"

	ENV_FLUENTD_OUTPUT = "FLUENTD_OUTPUT"
	ENV_FLUENTD_WORKER = "FLUENTD_WORKER"
)
View Source
const (
	ENV_PILOT_LOG_PREFIX     = "PILOT_LOG_PREFIX"
	ENV_PILOT_CREATE_SYMLINK = "PILOT_CREATE_SYMLINK"
	ENV_LOGGING_OUTPUT       = "LOGGING_OUTPUT"

	ENV_SERVICE_LOGS_TEMPL   = "%s_logs_"
	LABEL_SERVICE_LOGS_TEMPL = "%s.logs."
	LABEL_PROJECT_SWARM_MODE = "com.docker.stack.namespace"
	LABEL_PROJECT            = "com.docker.compose.project"
	LABEL_SERVICE            = "com.docker.compose.service"
	LABEL_SERVICE_SWARM_MODE = "com.docker.swarm.service.name"
	LABEL_K8S_POD_NAMESPACE  = "io.kubernetes.pod.namespace"
	LABEL_K8S_CONTAINER_NAME = "io.kubernetes.container.name"
	LABEL_POD                = "io.kubernetes.pod.name"
	SYMLINK_LOGS_BASE        = "/acs/log/"

	ERR_ALREADY_STARTED = "already started"
)
View Source
const (
	ENV_PILOT_TYPE = "PILOT_TYPE"

	PILOT_FILEBEAT = "filebeat"
	PILOT_FLUENTD  = "fluentd"
)

Variables

This section is empty.

Functions

func Convert

func Convert(info *LogInfoNode) (map[string]string, error)

func Register

func Register(format string, converter FormatConverter)

func Run

func Run(templ string, baseDir string) error

Types

type Config

type Config struct {
	Paths []string `config:"paths"`
}

type FileInode

type FileInode struct {
	Inode  uint64 `json:"inode,"`
	Device uint64 `json:"device,"`
}

type FilebeatPiloter

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

func (*FilebeatPiloter) GetConfHome added in v0.9.6

func (p *FilebeatPiloter) GetConfHome() string

func (*FilebeatPiloter) GetConfPath added in v0.9.6

func (p *FilebeatPiloter) GetConfPath(container string) string

func (*FilebeatPiloter) Name

func (p *FilebeatPiloter) Name() string

func (*FilebeatPiloter) OnDestroyEvent

func (p *FilebeatPiloter) OnDestroyEvent(container string) error

func (*FilebeatPiloter) Reload

func (p *FilebeatPiloter) Reload() error

func (*FilebeatPiloter) Start

func (p *FilebeatPiloter) Start() error

func (*FilebeatPiloter) Stop

func (p *FilebeatPiloter) Stop() error

type FluentdPiloter

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

func (*FluentdPiloter) GetConfHome added in v0.9.6

func (p *FluentdPiloter) GetConfHome() string

func (*FluentdPiloter) GetConfPath added in v0.9.6

func (p *FluentdPiloter) GetConfPath(container string) string

func (*FluentdPiloter) Name

func (p *FluentdPiloter) Name() string

func (*FluentdPiloter) OnDestroyEvent

func (p *FluentdPiloter) OnDestroyEvent(container string) error

func (*FluentdPiloter) Reload

func (p *FluentdPiloter) Reload() error

func (*FluentdPiloter) Start

func (p *FluentdPiloter) Start() error

func (*FluentdPiloter) Stop

func (p *FluentdPiloter) Stop() error

type FormatConverter

type FormatConverter func(info *LogInfoNode) (map[string]string, error)

type LogConfig

type LogConfig struct {
	Name         string
	HostDir      string
	ContainerDir string
	Format       string
	FormatConfig map[string]string
	File         string
	Tags         map[string]string
	Target       string
	EstimateTime bool
	Stdout       bool
}

type LogInfoNode

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

type Pilot

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

func New

func New(tplStr string, baseDir string) (*Pilot, error)

type Piloter

type Piloter interface {
	Name() string

	Start() error
	Reload() error
	Stop() error

	GetConfHome() string
	GetConfPath(container string) string

	OnDestroyEvent(container string) error
}

func NewFilebeatPiloter

func NewFilebeatPiloter(baseDir string) (Piloter, error)

func NewFluentdPiloter

func NewFluentdPiloter() (Piloter, error)

func NewPiloter added in v0.9.6

func NewPiloter(baseDir string) (Piloter, error)

type RegistryState

type RegistryState struct {
	Source      string        `json:"source"`
	Offset      int64         `json:"offset"`
	Timestamp   time.Time     `json:"timestamp"`
	TTL         time.Duration `json:"ttl"`
	Type        string        `json:"type"`
	FileStateOS FileInode
}

type SimpleConverter

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

Jump to

Keyboard shortcuts

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