nomad

package
v1.93.16-cluster Latest Latest
Warning

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

Go to latest
Published: Jul 17, 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.nomadSDCheckInterval", 30*time.Second, "Interval for checking for changes in Nomad. "+
	"This works only if nomad_sd_configs is configured in '-promscrape.config' file. "+
	"See https://docs.victoriametrics.com/sd_configs.html#nomad_sd_configs for details")

SDCheckInterval is check interval for Nomad service discovery.

Functions

This section is empty.

Types

type SDConfig

type SDConfig struct {
	Server    string `yaml:"server,omitempty"`
	Namespace string `yaml:"namespace,omitempty"`
	// RefreshInterval time.Duration `yaml:"refresh_interval"`
	// refresh_interval is obtained from `-promscrape.nomadSDCheckInterval` command-line option.
	Region       string  `yaml:"region,omitempty"`
	TagSeparator *string `yaml:"tag_separator,omitempty"`
	AllowStale   *bool   `yaml:"allow_stale,omitempty"`

	HTTPClientConfig  promauth.HTTPClientConfig  `yaml:",inline"`
	ProxyURL          *proxy.URL                 `yaml:"proxy_url,omitempty"`
	ProxyClientConfig promauth.ProxyClientConfig `yaml:",inline"`
}

SDConfig represents service discovery config for Nomad.

See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#nomad_sd_config

func (*SDConfig) GetLabels

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

GetLabels returns Nomad labels according to sdc.

func (*SDConfig) MustStop

func (sdc *SDConfig) MustStop()

MustStop stops further usage for sdc.

type Service

type Service struct {
	ID          string   `json:"ID"`
	ServiceName string   `json:"ServiceName"`
	Namespace   string   `json:"Namespace"`
	NodeID      string   `json:"NodeID"`
	Datacenter  string   `json:"Datacenter"`
	JobID       string   `json:"JobID"`
	AllocID     string   `json:"AllocID"`
	Tags        []string `json:"Tags"`
	Address     string   `json:"Address"`
	Port        int      `json:"Port"`
}

Service is Nomad service. See https://developer.hashicorp.com/nomad/api-docs/services#list-services

type ServiceList

type ServiceList struct {
	Namespace string `json:"Namespace"`
	Services  []struct {
		ServiceName string   `json:"ServiceName"`
		Tags        []string `json:"Tags"`
	} `json:"Services"`
}

ServiceList is a list of Nomad services. See https://developer.hashicorp.com/nomad/api-docs/services#list-services

Jump to

Keyboard shortcuts

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