Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
// > AuthStrategy.Strategy describes strategy to use.
Strategy string `json:"strategy" default:"disabled" options:"disabled|tenant|basic|bearer"`
Strategy_ AuthStrategy
// > TenantID for Tenant Authentication.
TenantID string `json:"tenant_id"`
// > Username for HTTP Basic Authentication.
Username string `json:"username"`
// > Password for HTTP Basic Authentication.
Password string `json:"password"`
// > Token for HTTP Bearer Authentication.
BearerToken string `json:"bearer_token"`
}
! config-params ^ config-params
type AuthStrategy ¶
type AuthStrategy byte
const ( StrategyDisabled AuthStrategy = iota StrategyTenant StrategyBasic StrategyBearer )
type Config ¶
type Config struct {
// > @3@4@5@6
// >
// > A full URI address of Loki
// >
// > Example address
// >
// > http://127.0.0.1:3100 or https://loki:3100
Address string `json:"address" required:"true"` // *
// > @3@4@5@6
// >
// > Array of labels to send logs
// >
// > Example labels
// >
// > label=value
Labels []Label `json:"labels" slice:"true"` // *
// > @3@4@5@6
// >
// > Message field from log to be mapped to loki
// >
// > Example
// >
// > message
MessageField string `json:"message_field" required:"true"` // *
// > @3@4@5@6
// >
// > Timestamp field from log to be mapped to loki
// >
// > Example
// >
// > timestamp
TimestampField string `json:"timestamp_field" required:"true"` // *
// > @3@4@5@6
// >
// > Auth config.
// >
// > `AuthConfig` params:
// > * `strategy` describes strategy to use; options:"disabled|tenant|basic|bearer"
// > By default strategy is `disabled`.
// > * `tenant_id` should be provided if strategy is `tenant`.
// > * `username` should be provided if strategy is `basic`.
// > Username is used for HTTP Basic Authentication.
// > * `password` should be provided if strategy is `basic`.
// > Password is used for HTTP Basic Authentication.
// > * `bearer_token` should be provided if strategy is `bearer`.
// > Token is used for HTTP Bearer Authentication.
Auth AuthConfig `json:"auth" child:"true"` // *
// > @3@4@5@6
// >
// > If set true, the plugin will use SSL/TLS connections method.
TLSEnabled bool `json:"tls_enabled" default:"false"` // *
// > @3@4@5@6
// >
// > If set, the plugin will skip SSL/TLS verification.
TLSSkipVerify bool `json:"tls_skip_verify" default:"false"` // *
// > @3@4@5@6
// >
// > Client timeout when sends requests to Loki HTTP API.
RequestTimeout cfg.Duration `json:"request_timeout" default:"1s" parse:"duration"` // *
RequestTimeout_ time.Duration
// > @3@4@5@6
// >
// > It defines how much time to wait for the connection.
ConnectionTimeout cfg.Duration `json:"connection_timeout" default:"5s" parse:"duration"` // *
ConnectionTimeout_ time.Duration
// > @3@4@5@6
// >
// > Keep-alive config.
// >
// > `KeepAliveConfig` params:
// > * `max_idle_conn_duration` - idle keep-alive connections are closed after this duration.
// > By default idle connections are closed after `10s`.
// > * `max_conn_duration` - keep-alive connections are closed after this duration.
// > If set to `0` - connection duration is unlimited.
// > By default connection duration is `5m`.
KeepAlive KeepAliveConfig `json:"keep_alive" child:"true"` // *
// > @3@4@5@6
// >
// > How much workers will be instantiated to send batches.
// > It also configures the amount of minimum and maximum number of database connections.
WorkersCount cfg.Expression `json:"workers_count" default:"gomaxprocs*4" parse:"expression"` // *
WorkersCount_ int
// > @3@4@5@6
// >
// > Maximum quantity of events to pack into one batch.
BatchSize cfg.Expression `json:"batch_size" default:"capacity/4" parse:"expression"` // *
BatchSize_ int
// > @3@4@5@6
// >
// > A minimum size of events in a batch to send.
// > If both batch_size and batch_size_bytes are set, they will work together.
BatchSizeBytes cfg.Expression `json:"batch_size_bytes" default:"0" parse:"expression"` // *
BatchSizeBytes_ int
// > @3@4@5@6
// >
// > After this timeout batch will be sent even if batch isn't completed.
BatchFlushTimeout cfg.Duration `json:"batch_flush_timeout" default:"200ms" parse:"duration"` // *
BatchFlushTimeout_ time.Duration
// > @3@4@5@6
// >
// > Retention milliseconds for retry to Loki.
Retention cfg.Duration `json:"retention" default:"1s" parse:"duration"` // *
Retention_ time.Duration
// > @3@4@5@6
// >
// > Retries of insertion. If File.d cannot insert for this number of attempts,
// > File.d will fall with non-zero exit code or skip message (see fatal_on_failed_insert).
Retry int `json:"retry" default:"10"` // *
// > @3@4@5@6
// >
// > After an insert error, fall with a non-zero exit code or not. A configured deadqueue disables fatal exits.
FatalOnFailedInsert bool `json:"fatal_on_failed_insert" default:"false"` // *
// > @3@4@5@6
// >
// > Multiplier for exponential increase of retention between retries
RetentionExponentMultiplier int `json:"retention_exponentially_multiplier" default:"2"` // *
}
! config-params ^ config-params
type KeepAliveConfig ¶
type KeepAliveConfig struct {
// Idle keep-alive connections are closed after this duration.
MaxIdleConnDuration cfg.Duration `json:"max_idle_conn_duration" parse:"duration" default:"10s"`
MaxIdleConnDuration_ time.Duration
// Keep-alive connections are closed after this duration.
MaxConnDuration cfg.Duration `json:"max_conn_duration" parse:"duration" default:"5m"`
MaxConnDuration_ time.Duration
}
Click to show internal directories.
Click to hide internal directories.