librato

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 13 Imported by: 0

README

Librato Output Plugin

This plugin writes metrics to the Librato service. It requires an api_user and api_token which can be obtained on the website for your account.

The source_tag option in the Configuration file is used to send contextual information from Point Tags to the API. Besides from this, the plugin currently does not send any additional associated Point Tags.

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

⭐ Telegraf v0.2.0 🏷️ cloud, datastore 💻 all

Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See CONFIGURATION.md for more details.

Secret-store support

This plugin supports secrets from secret-stores for the api_user and api_token option. See the secret-store documentation for more details on how to use them.

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/netxops/unicontroller/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 format

type LMetrics

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

LMetrics is the default struct for Librato's API format

type Librato

type Librato struct {
	APIUser  config.Secret   `toml:"api_user"`
	APIToken config.Secret   `toml:"api_token"`
	Debug    bool            `toml:"debug"`
	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 (*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