consul_agent

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: 12 Imported by: 0

README

Hashicorp Consul Agent Metrics Input Plugin

This plugin grabs metrics from a Consul agent. 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:8500.

Tested on Consul 1.10.4 .

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 Consul Agent API
[[inputs.consul_agent]]
  ## URL for the Consul agent
  # url = "http://127.0.0.1:8500"

  ## Use auth token for authorization.
  ## If both are set, an error is thrown.
  ## If both are empty, no token will be used.
  # token_file = "/path/to/auth/token"
  ## OR
  # token = "a1234567-40c7-9048-7bae-378687048181"

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

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

Metrics

Consul collects various metrics. For every details, please have a look at Consul following documentation:

Example Output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	Timestamp string
	Gauges    []GaugeValue
	Points    []PointValue
	Counters  []SampledValue
	Samples   []SampledValue
}

type ConsulAgent

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

	TokenFile string `toml:"token_file"`
	Token     string `toml:"token"`

	ResponseTimeout config.Duration `toml:"timeout"`

	tls.ClientConfig
	// contains filtered or unexported fields
}

consul_agent configuration object

func (*ConsulAgent) Gather

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

Gather, collects metrics from Consul endpoint

func (*ConsulAgent) Init

func (n *ConsulAgent) Init() error

func (*ConsulAgent) SampleConfig

func (*ConsulAgent) SampleConfig() string

type GaugeValue

type GaugeValue struct {
	Name   string
	Value  float32
	Labels map[string]string
}

type PointValue

type PointValue struct {
	Name   string
	Points []float32
}

type SampledValue

type SampledValue struct {
	Name   string
	Count  int
	Sum    float64
	Min    float64
	Max    float64
	Mean   float64
	Rate   float64
	Stddev float64
	Labels map[string]string
}

Jump to

Keyboard shortcuts

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