nomad

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 9 Imported by: 0

README

Hashicorp Nomad Input Plugin

The Nomad plugin must grab metrics from every Nomad agent of the cluster. Telegraf may be present in every node and connect to the agent locally. In this case should be something like http://127.0.0.1:4646.

Tested on Nomad 1.1.6

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Read metrics from the Nomad API
[[inputs.nomad]]
  ## URL for the Nomad agent
  # url = "http://127.0.0.1:4646"

  ## Set response_timeout (default 5 seconds)
  # response_timeout = "5s"

  ## Optional TLS Config
  # tls_ca = /path/to/cafile
  # tls_cert = /path/to/certfile
  # tls_key = /path/to/keyfile

Metrics

Both Nomad servers and agents collect various metrics. For every details, please have a look at Nomad following documentation:

Example Output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateSample

type AggregateSample struct {
	Count       int       `json:"count"`
	Rate        float64   `json:"rate"`
	Sum         float64   `json:"sum"`
	SumSq       float64   `json:"-"`
	Min         float64   `json:"min"`
	Max         float64   `json:"max"`
	LastUpdated time.Time `json:"-"`
}

type GaugeValue

type GaugeValue struct {
	Name  string  `json:"name"`
	Hash  string  `json:"-"`
	Value float32 `json:"value"`

	Labels        []Label           `json:"-"`
	DisplayLabels map[string]string `json:"Labels"`
}

type Label

type Label struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type MetricsSummary

type MetricsSummary struct {
	Timestamp string         `json:"timestamp"`
	Gauges    []GaugeValue   `json:"gauges"`
	Points    []PointValue   `json:"points"`
	Counters  []SampledValue `json:"counters"`
	Samples   []SampledValue `json:"samples"`
}

type Nomad

type Nomad struct {
	URL string `toml:"url"`

	ResponseTimeout config.Duration `toml:"response_timeout"`

	tls.ClientConfig
	// contains filtered or unexported fields
}

Nomad configuration object

func (*Nomad) Gather

func (n *Nomad) Gather(acc telegraf.Accumulator) error

Gather, collects metrics from Nomad endpoint

func (*Nomad) Init

func (n *Nomad) Init() error

func (*Nomad) SampleConfig

func (*Nomad) SampleConfig() string

type PointValue

type PointValue struct {
	Name   string    `json:"name"`
	Points []float32 `json:"points"`
}

type SampledValue

type SampledValue struct {
	Name string `json:"name"`
	Hash string `json:"-"`
	*AggregateSample
	Mean   float64 `json:"mean"`
	Stddev float64 `json:"stddev"`

	Labels        []Label           `json:"-"`
	DisplayLabels map[string]string `json:"Labels"`
}

Jump to

Keyboard shortcuts

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