Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultBatchWait = 1 * time.Second DefaultBatchSize int = 1024 * 1024 DefaultMinBackoff = 500 * time.Millisecond DefaultMaxBackoff = 5 * time.Minute DefaultMaxRetries int = 10 DefaultTimeout = 10 * time.Second DefaultKeepAlive = 30 * time.Second DefaultKeepAliveTimeout = 5 * time.Second )
Default configuration values for GRPC client
View Source
const (
// Label reserved to override the tenant ID while processing pipeline stages
ReservedLabelTenantID = "__tenant_id__"
)
Variables ¶
View Source
var (
UserAgent = fmt.Sprintf("loki-grpc-client/%s", version.Version)
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for pushing logs via GRPC
func NewWithSendCallbacks ¶
New creates a new GRPC client from config and send callbacks
type Config ¶
type Config struct {
// Server address (host:port)
ServerAddress string `yaml:"server_address"`
// Batching configuration
BatchWait time.Duration `yaml:"batch_wait"`
BatchSize int `yaml:"batch_size"`
// Connection configuration
Timeout time.Duration `yaml:"timeout"`
// TLS configuration (uses Prometheus common TLSConfig for consistency)
TLS promConfig.TLSConfig `yaml:"tls"`
// Keep alive configuration
KeepAlive time.Duration `yaml:"keep_alive"`
KeepAliveTimeout time.Duration `yaml:"keep_alive_timeout"`
// Retry configuration
BackoffConfig backoff.Config `yaml:"backoff_config"`
// Labels to add to any time series when communicating with loki
ExternalLabels labelutil.LabelSet `yaml:"external_labels,omitempty"`
// Tenant ID for multi-tenant mode (empty string means single tenant)
TenantID string `yaml:"tenant_id"`
}
Config describes configuration for a GRPC pusher client.
func NewDefaultConfig ¶
NewDefaultConfig creates a default configuration for a given GRPC server address.
func (*Config) BuildDialOptions ¶
func (c *Config) BuildDialOptions() ([]grpc.DialOption, error)
BuildDialOptions creates GRPC dial options from the configuration
func (*Config) RegisterFlags ¶
RegisterFlags registers configuration flags
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix registers flags with a given prefix
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements YAML unmarshaler
Click to show internal directories.
Click to hide internal directories.