librato

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 12 Imported by: 187

README

Librato Output Plugin

This plugin writes to the Librato Metrics API and requires an api_user and api_token which can be obtained here for the account.

The source_tag option in the Configuration file is used to send contextual information from Point Tags to the API.

If the point value being sent cannot be converted to a float64, the metric is skipped.

Currently, the plugin does not send any associated Point Tags.

Configuration

# Configuration for Librato API to send metrics to.
[[outputs.librato]]
  ## Librato API Docs
  ## http://dev.librato.com/v1/metrics-authentication
  ## Librato API user
  api_user = "telegraf@influxdb.com" # required.
  ## Librato API token
  api_token = "my-secret-token" # required.
  ## Debug
  # debug = false
  ## Connection timeout.
  # timeout = "5s"
  ## Output source Template (same as graphite buckets)
  ## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md#graphite
  ## This template is used in librato's source (not metric's name)
  template = "host"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gauge

type Gauge struct {
	Name        string  `json:"name"`
	Value       float64 `json:"value"`
	Source      string  `json:"source"`
	MeasureTime int64   `json:"measure_time"`
}

Gauge is the gauge format for Librato's API fromat

type LMetrics added in v1.14.0

type LMetrics struct {
	Gauges []*Gauge `json:"gauges"`
}

LMetrics is the default struct for Librato's API fromat

type Librato

type Librato struct {
	APIUser   string          `toml:"api_user"`
	APIToken  string          `toml:"api_token"`
	Debug     bool            `toml:"debug"`
	SourceTag string          `toml:"source_tag" deprecated:"1.0.0;use 'template' instead"`
	Timeout   config.Duration `toml:"timeout"`
	Template  string          `toml:"template"`
	Log       telegraf.Logger `toml:"-"`

	APIUrl string
	// contains filtered or unexported fields
}

Librato structure for configuration and client

func NewLibrato

func NewLibrato(apiURL string) *Librato

NewLibrato is the main constructor for librato output plugins

func (*Librato) Close

func (l *Librato) Close() error

Close is used to close the connection to librato Output

func (*Librato) Connect

func (l *Librato) Connect() error

Connect is the default output plugin connection function who make sure it can connect to the endpoint

func (*Librato) SampleConfig

func (*Librato) SampleConfig() string

func (*Librato) Write

func (l *Librato) Write(metrics []telegraf.Metric) error

Jump to

Keyboard shortcuts

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