targets

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileTargetType a file target
	FileTargetType = TargetType("File")
)
View Source
const (
	FilenameLabel = "filename"
)

Variables

This section is empty.

Functions

func IsDropped

func IsDropped(t Target) bool

IsDropped tells if a target has been dropped

Types

type Config

type Config struct {
	SyncPeriod time.Duration `yaml:"sync_period"`
}

Config describes behavior for Target

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(flags *flag.FlagSet)

RegisterFlags register flags.

type FileTarget

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

FileTarget describes a particular set of logs.

func NewFileTarget

func NewFileTarget(logger log.Logger, handler api.EntryHandler, positions *positions.Positions, path string, labels model.LabelSet, discoveredLabels model.LabelSet, targetConfig *Config) (*FileTarget, error)

NewFileTarget create a new FileTarget.

func (*FileTarget) Details

func (t *FileTarget) Details() interface{}

Details implements a Target

func (*FileTarget) DiscoveredLabels

func (t *FileTarget) DiscoveredLabels() model.LabelSet

DiscoveredLabels implements a Target

func (*FileTarget) Labels

func (t *FileTarget) Labels() model.LabelSet

Labels implements a Target

func (*FileTarget) Ready

func (t *FileTarget) Ready() bool

Ready if at least one file is being tailed

func (*FileTarget) Stop

func (t *FileTarget) Stop()

Stop the target.

func (*FileTarget) Type

func (t *FileTarget) Type() TargetType

Type implements a Target

type FileTargetManager

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

FileTargetManager manages a set of targets.

func NewFileTargetManager

func NewFileTargetManager(
	logger log.Logger,
	positions *positions.Positions,
	client api.EntryHandler,
	scrapeConfigs []scrape.Config,
	targetConfig *Config,
) (*FileTargetManager, error)

NewFileTargetManager creates a new TargetManager.

func (*FileTargetManager) ActiveTargets

func (tm *FileTargetManager) ActiveTargets() map[string][]Target

ActiveTargets returns the active targets currently being scraped.

func (*FileTargetManager) AllTargets

func (tm *FileTargetManager) AllTargets() map[string][]Target

AllTargets returns all targets, active and dropped.

func (*FileTargetManager) Ready

func (tm *FileTargetManager) Ready() bool

Ready if there's at least one file target

func (*FileTargetManager) Stop

func (tm *FileTargetManager) Stop()

Stop the TargetManager.

type Target

type Target interface {
	// Type of the target
	Type() TargetType
	// Ready tells if the targets is ready
	Ready() bool
	// Labels before any processing.
	DiscoveredLabels() model.LabelSet
	// Any labels that are added to this target and its stream
	Labels() model.LabelSet
	// Details is additional information about this target specific to its type
	Details() interface{}
}

Target is a promtail scrape target

type TargetManagers

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

TargetManagers manages a list of target managers.

func NewTargetManagers

func NewTargetManagers(
	logger log.Logger,
	positions *positions.Positions,
	client api.EntryHandler,
	scrapeConfigs []scrape.Config,
	targetConfig *Config,
) (*TargetManagers, error)

NewTargetManagers makes a new TargetManagers

func (*TargetManagers) ActiveTargets

func (tm *TargetManagers) ActiveTargets() map[string][]Target

ActiveTargets returns active targets per jobs

func (*TargetManagers) AllTargets

func (tm *TargetManagers) AllTargets() map[string][]Target

AllTargets returns all targets per jobs

func (*TargetManagers) Ready

func (tm *TargetManagers) Ready() bool

Ready if there's at least one ready FileTargetManager

func (*TargetManagers) Stop

func (tm *TargetManagers) Stop()

Stop the TargetManagers.

type TargetType

type TargetType string

TargetType is the type of target

Jump to

Keyboard shortcuts

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