nomad

package
v0.0.0-...-b274fa0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientScrapeConfig = prometheus.ScrapeConfig{
	JobName:     "nomad-clients",
	Params:      url.Values{"format": []string{"prometheus"}},
	MetricsPath: "/v1/metrics",
	ConsulServiceDiscoveryConfigs: []prometheus.ConsulServiceDiscoveryConfig{
		{
			Server: "127.0.0.1:8500",
		},
	},
	RelabelConfigs: []prometheus.RelabelConfig{
		{
			Action:       prometheus.Keep,
			SourceLabels: model.LabelNames{model.MetaLabelPrefix + "consul_tags"},
			Regex:        ".*,prom,.*",
		},
	},
}
View Source
var PortNames = struct {
	HTTP string
	Serf string
	RPC  string
}{
	"http",
	"serf",
	"rpc",
}
View Source
var ServerScrapeConfig = prometheus.ScrapeConfig{
	JobName:     "nomad",
	Params:      url.Values{"format": []string{"prometheus"}},
	MetricsPath: "/v1/metrics",
	RelabelConfigs: []prometheus.RelabelConfig{
		{
			Action:       prometheus.Replace,
			SourceLabels: model.LabelNames{model.MetricNameLabel},
			Regex:        "nomad_raft_replication_(appendEntries_rpc|appendEntries_logs|heartbeat|installSnapshot)_([^:]*:\\d+)(_sum|_count)?",
			TargetLabel:  model.MetricNameLabel,
			Replacement:  "nomad_raft_replication_${1}${3}",
		},
		{
			Action:       prometheus.Replace,
			SourceLabels: model.LabelNames{model.MetricNameLabel},
			Regex:        "nomad_raft_replication_(appendEntries_rpc|appendEntries_logs|heartbeat|installSnapshot)_([^:]*:\\d+)(_sum|_count)?",
			TargetLabel:  "raft_id",
			Replacement:  "${2}",
		},
	},
}

Functions

func HarnessToAPI

func HarnessToAPI(r runner.Harness) (*nomadapi.Client, error)

func LeadersHealthy

func LeadersHealthy(ctx context.Context, servers []runner.Harness, expectedPeers []string) error

Types

type NomadConfig

type NomadConfig struct {
	Common runner.Config
	// BootstrapExpect is how many servers to wait for when bootstrapping;
	// set this to 0 for clients.
	BootstrapExpect int
	// ConsulAddr is the address of the (normally local) consul agent, format is Host:Port
	ConsulAddr string
}

func NewConfig

func NewConfig(bootstrapExpect int, consulAddr string, tls *pki.TLSConfigPEM) NomadConfig

func (NomadConfig) Args

func (nc NomadConfig) Args() []string

func (NomadConfig) Config

func (nc NomadConfig) Config() runner.Config

func (NomadConfig) Env

func (nc NomadConfig) Env() []string

func (NomadConfig) Files

func (nc NomadConfig) Files() map[string]string

func (NomadConfig) Name

func (nc NomadConfig) Name() string

func (NomadConfig) WithConfig

func (nc NomadConfig) WithConfig(cfg runner.Config) runner.Command

type Ports

type Ports struct {
	HTTP int
	Serf int
	RPC  int
}

func DefPorts

func DefPorts() Ports

func (Ports) RunnerPorts

func (c Ports) RunnerPorts() yurt.Ports

Jump to

Keyboard shortcuts

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