Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func New(metrics *Metrics, cfg Config, streamLagLabels []string, maxStreams int, ...) (Client, error)
- func NewLogger(metrics *Metrics, streamLogLabels []string, log log.Logger, cfgs ...Config) (Client, error)
- func NewMulti(metrics *Metrics, streamLagLabels []string, logger log.Logger, maxStreams int, ...) (Client, error)
- func NewWithTripperware(metrics *Metrics, cfg Config, streamLagLabels []string, maxStreams int, ...) (Client, error)
- type Config
- type Metrics
- type MultiClient
- type Tripperware
Constants ¶
View Source
const ( // Label reserved to override the tenant ID while processing // pipeline stages ReservedLabelTenantID = "__tenant_id__" LatencyLabel = "filename" HostLabel = "host" ClientLabel = "client" )
View Source
const ( BatchWait = 1 * time.Second BatchSize int = 1024 * 1024 MinBackoff = 500 * time.Millisecond MaxBackoff = 5 * time.Minute MaxRetries int = 10 Timeout = 10 * time.Second )
NOTE the helm chart for promtail and fluent-bit also have defaults for these values, please update to match if you make changes here.
Variables ¶
View Source
var UserAgent = fmt.Sprintf("GrafanaAgent/%s", build.Version)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { loki.EntryHandler // Stop goroutine sending batch of entries without retries. StopNow() Name() string }
Client pushes entries to Loki and can be stopped
func New ¶
func New(metrics *Metrics, cfg Config, streamLagLabels []string, maxStreams int, logger log.Logger) (Client, error)
New makes a new Client.
func NewLogger ¶
func NewLogger(metrics *Metrics, streamLogLabels []string, log log.Logger, cfgs ...Config) (Client, error)
NewLogger creates a new client logger that logs entries instead of sending them.
type Config ¶
type Config struct { Name string `yaml:"name,omitempty"` URL flagext.URLValue Headers map[string]string `yaml:"headers,omitempty"` BatchWait time.Duration BatchSize int Client config.HTTPClientConfig `yaml:",inline"` BackoffConfig backoff.Config `yaml:"backoff_config"` // The labels to add to any time series or alerts when communicating with loki ExternalLabels lokiflag.LabelSet `yaml:"external_labels,omitempty"` Timeout time.Duration `yaml:"timeout"` // The tenant ID to use when pushing logs to Loki (empty string means // single tenant mode) TenantID string `yaml:"tenant_id"` // deprecated use StreamLagLabels from config.Config instead StreamLagLabels flagext.StringSliceCSV `yaml:"stream_lag_labels"` }
Config describes configuration for an HTTP pusher client.
func (*Config) RegisterFlags ¶
RegisterFlags registers flags.
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlags with prefix registers flags where every name is prefixed by prefix. If prefix is a non-empty string, prefix should end with a period.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implement Yaml Unmarshaler
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer, streamLagLabels []string) *Metrics
type MultiClient ¶
type MultiClient struct {
// contains filtered or unexported fields
}
MultiClient is client pushing to one or more loki instances.
func (*MultiClient) Chan ¶
func (m *MultiClient) Chan() chan<- loki.Entry
func (*MultiClient) Name ¶
func (m *MultiClient) Name() string
type Tripperware ¶
type Tripperware func(http.RoundTripper) http.RoundTripper
Tripperware can wrap a roundtripper.
Click to show internal directories.
Click to hide internal directories.