consulagent

package
v1.101.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SDCheckInterval = flag.Duration("promscrape.consulagentSDCheckInterval", 30*time.Second, "Interval for checking for changes in Consul Agent. "+
	"This works only if consulagent_sd_configs is configured in '-promscrape.config' file. "+
	"See https://docs.victoriametrics.com/sd_configs/#consulagent_sd_configs for details")

SDCheckInterval is check interval for Consul Agent service discovery.

Functions

This section is empty.

Types

type SDConfig

type SDConfig struct {
	Server     string           `yaml:"server,omitempty"`
	Token      *promauth.Secret `yaml:"token"`
	Datacenter string           `yaml:"datacenter"`

	// Namespace only supported at enterprise consul.
	// https://www.consul.io/docs/enterprise/namespaces
	Namespace string `yaml:"namespace,omitempty"`

	Scheme            string                     `yaml:"scheme,omitempty"`
	Username          string                     `yaml:"username"`
	Password          *promauth.Secret           `yaml:"password"`
	HTTPClientConfig  promauth.HTTPClientConfig  `yaml:",inline"`
	ProxyURL          *proxy.URL                 `yaml:"proxy_url,omitempty"`
	ProxyClientConfig promauth.ProxyClientConfig `yaml:",inline"`
	Services          []string                   `yaml:"services,omitempty"`
	TagSeparator      *string                    `yaml:"tag_separator,omitempty"`
	// See https://developer.hashicorp.com/consul/api-docs/features/filtering
	// list of supported filters https://developer.hashicorp.com/consul/api-docs/catalog#filtering-1
	Filter string `yaml:"filter,omitempty"`
}

SDConfig represents service discovery config for Consul Agent.

See https://grafana.com/docs/loki/latest/clients/promtail/configuration/#consulagent_sd_config

func (*SDConfig) GetLabels

func (sdc *SDConfig) GetLabels(baseDir string) ([]*promutils.Labels, error)

GetLabels returns Consul labels according to sdc.

func (*SDConfig) MustStop

func (sdc *SDConfig) MustStop()

MustStop stops further usage for sdc.

Jump to

Keyboard shortcuts

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