Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultScrapeConfig = Config{ PipelineStages: []interface{}{ map[interface{}]interface{}{ stages.StageTypeDocker: nil, }, }, }
DefaultScrapeConfig is the default Config.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
JobName string `yaml:"job_name,omitempty"`
PipelineStages stages.PipelineStages `yaml:"pipeline_stages,omitempty"`
JournalConfig *JournalTargetConfig `yaml:"journal,omitempty"`
SyslogConfig *SyslogTargetConfig `yaml:"syslog,omitempty"`
PushConfig *PushTargetConfig `yaml:"loki_push_api,omitempty"`
RelabelConfigs []*relabel.Config `yaml:"relabel_configs,omitempty"`
ServiceDiscoveryConfig ServiceDiscoveryConfig `yaml:",inline"`
}
Config describes a job to scrape.
func (*Config) HasServiceDiscoveryConfig ¶
HasServiceDiscoveryConfig checks to see if the service discovery used for file targets is non-zero.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type JournalTargetConfig ¶
type JournalTargetConfig struct {
// MaxAge determines the oldest relative time from process start that will
// be read and sent to Loki. Values like 14h means no entry older than
// 14h will be read. If unspecified, defaults to 7h.
//
// A relative time specified here takes precedence over the saved position;
// if the cursor is older than the MaxAge value, it will not be used.
MaxAge string `yaml:"max_age"`
// JSON forces the output message of entries read from the journal to be
// JSON. The message will contain all original fields from the source
// journal entry.
JSON bool `yaml:"json"`
// Labels optionally holds labels to associate with each record coming out
// of the journal.
Labels model.LabelSet `yaml:"labels"`
// Path to a directory to read journal entries from. Defaults to system path
// if empty.
Path string `yaml:"path"`
}
JournalTargetConfig describes systemd journal records to scrape.
type PushTargetConfig ¶
type PushTargetConfig struct {
// Server is the weaveworks server config for listening connections
Server server.Config `yaml:"server"`
// Labels optionally holds labels to associate with each record received on the push api.
Labels model.LabelSet `yaml:"labels"`
// If promtail should maintain the incoming log timestamp or replace it with the current time.
KeepTimestamp bool `yaml:"use_incoming_timestamp"`
}
PushTargetConfig describes a scrape config that listens for Loki push messages.
type ServiceDiscoveryConfig ¶
type ServiceDiscoveryConfig struct {
// List of labeled target groups for this job.
StaticConfigs discovery.StaticConfig `yaml:"static_configs"`
// List of DNS service discovery configurations.
DNSSDConfigs []*dns.SDConfig `yaml:"dns_sd_configs,omitempty"`
// List of file service discovery configurations.
FileSDConfigs []*file.SDConfig `yaml:"file_sd_configs,omitempty"`
// List of Consul service discovery configurations.
ConsulSDConfigs []*consul.SDConfig `yaml:"consul_sd_configs,omitempty"`
// List of DigitalOcean service discovery configurations.
DigitalOceanSDConfigs []*digitalocean.SDConfig `yaml:"digitalocean_sd_configs,omitempty"`
// List of Docker Swarm service discovery configurations.
DockerSwarmSDConfigs []*dockerswarm.SDConfig `yaml:"dockerswarm_sd_configs,omitempty"`
// List of Serverset service discovery configurations.
ServersetSDConfigs []*zookeeper.ServersetSDConfig `yaml:"serverset_sd_configs,omitempty"`
// NerveSDConfigs is a list of Nerve service discovery configurations.
NerveSDConfigs []*zookeeper.NerveSDConfig `yaml:"nerve_sd_configs,omitempty"`
// MarathonSDConfigs is a list of Marathon service discovery configurations.
MarathonSDConfigs []*marathon.SDConfig `yaml:"marathon_sd_configs,omitempty"`
// List of Kubernetes service discovery configurations.
KubernetesSDConfigs []*kubernetes.SDConfig `yaml:"kubernetes_sd_configs,omitempty"`
// List of GCE service discovery configurations.
GCESDConfigs []*gce.SDConfig `yaml:"gce_sd_configs,omitempty"`
// List of EC2 service discovery configurations.
EC2SDConfigs []*ec2.SDConfig `yaml:"ec2_sd_configs,omitempty"`
// List of OpenStack service discovery configurations.
OpenstackSDConfigs []*openstack.SDConfig `yaml:"openstack_sd_configs,omitempty"`
// List of Azure service discovery configurations.
AzureSDConfigs []*azure.SDConfig `yaml:"azure_sd_configs,omitempty"`
// List of Triton service discovery configurations.
TritonSDConfigs []*triton.SDConfig `yaml:"triton_sd_configs,omitempty"`
}
func (ServiceDiscoveryConfig) Configs ¶
func (cfg ServiceDiscoveryConfig) Configs() (res discovery.Configs)
type SyslogTargetConfig ¶
type SyslogTargetConfig struct {
// ListenAddress is the address to listen on for syslog messages.
ListenAddress string `yaml:"listen_address"`
// IdleTimeout is the idle timeout for tcp connections.
IdleTimeout time.Duration `yaml:"idle_timeout"`
// LabelStructuredData sets if the structured data part of a syslog message
// is translated to a label.
// [example@99999 test="yes"] => {__syslog_message_sd_example_99999_test="yes"}
LabelStructuredData bool `yaml:"label_structured_data"`
// Labels optionally holds labels to associate with each record read from syslog.
Labels model.LabelSet `yaml:"labels"`
}
SyslogTargetConfig describes a scrape config that listens for log lines over syslog.
Click to show internal directories.
Click to hide internal directories.