influxdb

package
v0.0.0-...-b0852c1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BackendName is the name of this backend.
	BackendName = "influxdb"
)

Variables

This section is empty.

Functions

func NewClientFromViper

func NewClientFromViper(
	v *viper.Viper,
	logger logrus.FieldLogger,
	pool *transport.TransportPool,
) (gostatsd.Backend, error)

NewClientFromViper returns a new InfluxDB API client.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents an InfluxDB client.

func NewClient

func NewClient(
	apiEndpoint string,
	compressPayload bool,
	credentials string,
	maxRequests uint,
	maxRequestElapsedTime time.Duration,
	metricsPerBatch uint64,
	transport string,
	cfg config,
	disabled gostatsd.TimerSubtypes,
	logger logrus.FieldLogger,
	pool *transport.TransportPool,
) (*Client, error)

NewClient returns a new InfluxDB API client.

func (*Client) Name

func (idb *Client) Name() string

Name returns the name of the backend.

func (*Client) Run

func (idb *Client) Run(ctx context.Context)

func (*Client) SendEvent

func (idb *Client) SendEvent(ctx context.Context, e *gostatsd.Event) error

func (*Client) SendMetricsAsync

func (idb *Client) SendMetricsAsync(ctx context.Context, metrics *gostatsd.MetricMap, cb gostatsd.SendCallback)

SendMetricsAsync flushes the metrics to Influxdb, preparing payload synchronously but doing the send asynchronously.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL