consul_agent

package
v1.33.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 13 Imported by: 0

README

Hashicorp Consul Agent Input Plugin

This plugin collects metrics from a Consul agent. Telegraf may be present in every node and connect to the agent locally. Tested on Consul v1.10.

⭐ Telegraf v1.22.0 🏷️ server 💻 all

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's documentation.

Example Output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
}

func (*ConsulAgent) Gather

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

func (*ConsulAgent) Init

func (n *ConsulAgent) Init() error

func (*ConsulAgent) SampleConfig

func (*ConsulAgent) SampleConfig() string

Jump to

Keyboard shortcuts

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