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
// >
// > Prometheus remote write endpoint URL.
Endpoint string `json:"endpoint" default:"http://localhost:9090/api/v1/write"` // *
// > @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
// >
// > TLS config.
// >
// > `TLSConfig` params:
// > * `ca_cert` - path or content of a PEM-encoded CA file
// > * `client_cert` - path or content of a PEM-encoded client certificate file
// > * `client_key` - path or content of a PEM-encoded client key file
// > * `insecure` - if set, the plugin will skip SSL/TLS verification
TLS *cfg.TLSConfig `json:"tls"` // *
// > @3@4@5@6
// >
// > Client timeout when sends requests to Prometheus 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
// >
// > Retries of upload. If File.d cannot upload 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
FatalOnFailedInsert bool `json:"fatal_on_failed_insert" default:"false"` // *
// > @3@4@5@6
// >
// > Retention milliseconds for retry to upload.
Retention cfg.Duration `json:"retention" default:"1s" parse:"duration"` // *
Retention_ time.Duration
// > @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
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
type PrometheusClient ¶
type PrometheusClient interface {
Write(ctx context.Context, req *promwrite.WriteRequest, options ...promwrite.WriteOption) (*promwrite.WriteResponse, error)
}
Click to show internal directories.
Click to hide internal directories.