Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultScrapeConfig = ScrapeConfig{ EntryParser: Docker, }
DefaultScrapeConfig is the default ScrapeConfig.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for pushing logs in snappy-compressed protos over HTTP.
func NewClient ¶
func NewClient(cfg ClientConfig, logger log.Logger) (*Client, error)
NewClient makes a new Client.
type ClientConfig ¶
type ClientConfig struct {
URL flagext.URLValue
BatchWait time.Duration
BatchSize int
ExternalLabels model.LabelSet `yaml:"external_labels,omitempty"`
}
ClientConfig describes configuration for a HTTP pusher client.
func (*ClientConfig) RegisterFlags ¶
func (c *ClientConfig) RegisterFlags(flags *flag.FlagSet)
RegisterFlags registers flags.
type Config ¶
type Config struct {
ServerConfig server.Config `yaml:"server,omitempty"`
ClientConfig ClientConfig `yaml:"client,omitempty"`
PositionsConfig PositionsConfig `yaml:"positions,omitempty"`
ScrapeConfig []ScrapeConfig `yaml:"scrape_configs,omitempty"`
}
Config for promtail, describing what files to watch.
func LoadConfig ¶
LoadConfig loads config from a file.
func (*Config) RegisterFlags ¶
RegisterFlags registers flags.
type EntryHandler ¶
EntryHandler is something that can "handle" entries.
type EntryHandlerFunc ¶
EntryHandlerFunc is modelled on http.HandlerFunc.
type EntryMiddleware ¶
type EntryMiddleware interface {
Wrap(next EntryHandler) EntryHandler
}
EntryMiddleware is something that takes on EntryHandler and produces another.
type EntryMiddlewareFunc ¶
type EntryMiddlewareFunc func(next EntryHandler) EntryHandler
EntryMiddlewareFunc is modelled on http.HandlerFunc.
func (EntryMiddlewareFunc) Wrap ¶
func (e EntryMiddlewareFunc) Wrap(next EntryHandler) EntryHandler
Wrap implements EntryMiddleware.
type EntryParser ¶
type EntryParser int
EntryParser describes how to parse log lines.
const ( Docker EntryParser = iota Raw )
Different supported EntryParsers.
func (EntryParser) String ¶
func (e EntryParser) String() string
String returns a string representation of the EnEntryParser.
func (*EntryParser) UnmarshalYAML ¶
func (e *EntryParser) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaler.
func (EntryParser) Wrap ¶
func (e EntryParser) Wrap(next EntryHandler) EntryHandler
Wrap implements EntryMiddleware.
type Positions ¶
type Positions struct {
// contains filtered or unexported fields
}
Positions tracks how far through each file we've read.
func NewPositions ¶
func NewPositions(logger log.Logger, cfg PositionsConfig) (*Positions, error)
NewPositions makes a new Positions.
type PositionsConfig ¶
type PositionsConfig struct {
SyncPeriod time.Duration `yaml:"sync_period"`
PositionsFile string `yaml:"filename"`
}
PositionsConfig describes where to get postition information from.
func (*PositionsConfig) RegisterFlags ¶
func (cfg *PositionsConfig) RegisterFlags(flags *flag.FlagSet)
RegisterFlags register flags.
type Promtail ¶
type Promtail struct {
// contains filtered or unexported fields
}
Promtail is the root struct for Promtail...
type ScrapeConfig ¶
type ScrapeConfig struct {
JobName string `yaml:"job_name,omitempty"`
EntryParser EntryParser `yaml:"entry_parser"`
RelabelConfigs []*relabel.Config `yaml:"relabel_configs,omitempty"`
ServiceDiscoveryConfig sd_config.ServiceDiscoveryConfig `yaml:",inline"`
}
ScrapeConfig describes a job to scrape.
func (*ScrapeConfig) UnmarshalYAML ¶
func (c *ScrapeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target describes a particular set of logs.
type TargetManager ¶
type TargetManager struct {
// contains filtered or unexported fields
}
TargetManager manages a set of targets.
func NewTargetManager ¶
func NewTargetManager( logger log.Logger, positions *Positions, client EntryHandler, scrapeConfig []ScrapeConfig, ) (*TargetManager, error)
NewTargetManager creates a new TargetManager.