Documentation ¶
Index ¶
- type Agent
- type Input
- type Option
- func WithInput(inputs ...Input) Option
- func WithOutput(output Output) Option
- func WithOutputDebug(v bool) Option
- func WithReaderBatchSize(batchSize int) Option
- func WithReaderInterval(interval time.Duration) Option
- func WithReaderOutputInterval(interval time.Duration) Option
- func WithReaderQueueSize(queueSize int) Option
- func WithReaderTags(tags map[string]string) Option
- type Options
- type Output
- type OutputOption
- type OutputOptions
- type Reader
- type ReaderOption
- type ReaderOptions
- type RemoteWriter
- type RemoteWriterOption
- func WithBasicPassword(basicPassword string) RemoteWriterOption
- func WithBasicUsername(username string) RemoteWriterOption
- func WithDialTimeout(dialTimeout time.Duration) RemoteWriterOption
- func WithMaxIdleConnsPerHost(v int) RemoteWriterOption
- func WithResponseHeaderTimeout(timeout time.Duration) RemoteWriterOption
- type RemoteWriterOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Input ¶
type Input interface { // Init initializes the input. Init() error // Gather gathers the data. Gather() ([]*types.Sample, error) // GetInterval returns the interval of the input. GetInterval() time.Duration // Prefix returns the prefix of the input. Prefix() string // String returns the name of the input. String() string // Close closes the input. Close() error }
type Option ¶
type Option func(o *Options)
func WithOutputDebug ¶
WithOutputDebug sets a debug mode for the output.
func WithReaderBatchSize ¶
WithReaderBatchSize sets a batch size for the reader.
func WithReaderInterval ¶
WithReaderInterval sets an interval for the reader.
func WithReaderOutputInterval ¶
WithReaderOutputInterval sets an interval for the output.
func WithReaderQueueSize ¶
WithReaderQueueSize sets a queue size for the reader.
func WithReaderTags ¶
WithReaderTags sets tags to use for the reader.
type Options ¶
type Options struct { Debug bool // debug mode Inputs []Input // inputs to use Output Output // output to use ReaderOptions ReaderOptions // reader options }
type Output ¶
Output interface wraps the Write method.
func NewOutput ¶
func NewOutput(remote RemoteWriter, opts ...OutputOption) Output
NewOutput returns a new Output.
type OutputOption ¶
type OutputOption func(o *OutputOptions)
func WithTimeout ¶
func WithTimeout(timeout time.Duration) OutputOption
WithTimeout sets a timeout for the output.
type OutputOptions ¶
type OutputOptions struct { Debug bool // debug mode Timeout time.Duration // timeout for the output RemoteWriter RemoteWriter // Prometheus Protocol remote writer to use }
type Reader ¶
type ReaderOption ¶
type ReaderOption func(o *ReaderOptions)
func WithBatchSize ¶
func WithBatchSize(batchSize int) ReaderOption
WithBatchSize sets a batch size for the reader.
func WithInterval ¶
func WithInterval(interval time.Duration) ReaderOption
WithInterval sets an interval for the reader.
func WithOutputInterval ¶
func WithOutputInterval(interval time.Duration) ReaderOption
WithOutputInterval sets an interval for the output.
func WithQueueSize ¶
func WithQueueSize(queueSize int) ReaderOption
WithQueueSize sets a queue size for the reader.
func WithTags ¶
func WithTags(tags map[string]string) ReaderOption
WithTags sets tags to use for the reader.
type ReaderOptions ¶
type RemoteWriter ¶
type RemoteWriter interface {
Write(ctx context.Context, items []prompb.TimeSeries) error
}
RemoteWriter interface wraps the Write method.
func NewRemoteWriter ¶
func NewRemoteWriter(endpoint string, opts ...RemoteWriterOption) (RemoteWriter, error)
NewRemoteWriter returns a RemoteWriter.
type RemoteWriterOption ¶
type RemoteWriterOption func(o *RemoteWriterOptions)
func WithBasicPassword ¶
func WithBasicPassword(basicPassword string) RemoteWriterOption
WithBasicPassword sets a basic auth password to use.
func WithBasicUsername ¶
func WithBasicUsername(username string) RemoteWriterOption
WithBasicUsername sets a basic auth username to use.
func WithDialTimeout ¶
func WithDialTimeout(dialTimeout time.Duration) RemoteWriterOption
WithDialTimeout sets a timeout for the dial.
func WithMaxIdleConnsPerHost ¶
func WithMaxIdleConnsPerHost(v int) RemoteWriterOption
WithMaxIdleConnsPerHost sets a max idle conns per host to use.
func WithResponseHeaderTimeout ¶
func WithResponseHeaderTimeout(timeout time.Duration) RemoteWriterOption
WithResponseHeaderTimeout sets a timeout for the response header.
type RemoteWriterOptions ¶
type RemoteWriterOptions struct { Endpoint string // endpoint of the remote writer BasicUsername string // basic auth username BasicPassword string // basic auth password DialTimeout time.Duration // timeout for the dial ResponseHeaderTimeout time.Duration // timeout for the response header MaxIdleConnsPerHost int // max idle conns per host }