Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PortNames = struct { HTTP string DNS string SerfLAN string SerfWAN string Server string }{ "http", "dns", "serf-lan", "serf-wan", "server", }
View Source
var ServerScrapeConfig = prometheus.ScrapeConfig{ JobName: "consul", Params: url.Values{"format": []string{"prometheus"}}, MetricsPath: "/v1/agent/metrics", RelabelConfigs: []prometheus.RelabelConfig{ { Action: prometheus.Replace, SourceLabels: model.LabelNames{model.MetricNameLabel}, Regex: "consul_raft_replication_(appendEntries_rpc|appendEntries_logs|heartbeat|installSnapshot)_((\\w){36})((_sum)|(_count))?", TargetLabel: model.MetricNameLabel, Replacement: "consul_raft_replication_${1}${4}", }, { Action: prometheus.Replace, SourceLabels: model.LabelNames{model.MetricNameLabel}, Regex: "consul_raft_replication_(appendEntries_rpc|appendEntries_logs|heartbeat|installSnapshot)_((\\w){36})((_sum)|(_count))?", TargetLabel: "raft_id", Replacement: "${2}", }, }, }
View Source
var ServiceScrapeConfig = prometheus.ScrapeConfig{ JobName: "consul-services", ConsulServiceDiscoveryConfigs: []prometheus.ConsulServiceDiscoveryConfig{ { Server: "127.0.0.1:8500", }, }, RelabelConfigs: []prometheus.RelabelConfig{ { Action: prometheus.Keep, SourceLabels: model.LabelNames{model.MetaLabelPrefix + "consul_tags"}, Regex: ".*,prom,.*", }, { Action: prometheus.Replace, SourceLabels: model.LabelNames{model.MetaLabelPrefix + "consul_service"}, TargetLabel: model.JobLabel, }, }, }
Functions ¶
Types ¶
type ConsulConfig ¶
type ConsulConfig struct { Common runner.Config Server bool // JoinAddrs specifies the addresses of the Consul servers. If they have // a :port suffix, it should be that of the SerfLAN port. JoinAddrs []string }
ConsulConfig describes how to run a single Consul agent.
func NewConfig ¶
func NewConfig(server bool, joinAddrs []string, tls *pki.TLSConfigPEM) ConsulConfig
func (ConsulConfig) Args ¶
func (cc ConsulConfig) Args() []string
func (ConsulConfig) Config ¶
func (cc ConsulConfig) Config() runner.Config
func (ConsulConfig) Env ¶
func (cc ConsulConfig) Env() []string
func (ConsulConfig) Files ¶
func (cc ConsulConfig) Files() map[string]string
func (ConsulConfig) Name ¶
func (cc ConsulConfig) Name() string
func (ConsulConfig) WithConfig ¶
func (cc ConsulConfig) WithConfig(cfg runner.Config) runner.Command
Click to show internal directories.
Click to hide internal directories.