server

package
v0.0.0-...-a17e1e9 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

FS defines file system used to read and write configuration files

View Source
var New = func() *serve {
	promConfig := os.Getenv("ARG_CONFIG_FILE")
	if len(promConfig) == 0 {
		promConfig = "/etc/prometheus/prometheus.yml"
	}
	alertIfShortcutData = GetShortcuts()
	return &serve{
		alerts:     make(map[string]prometheus.Alert),
		scrapes:    make(map[string]prometheus.Scrape),
		nodeLabels: make(map[string]map[string]string),
		configPath: promConfig,
	}
}

New returns instance of the `serve` structure

Functions

func GetShortcuts

func GetShortcuts() map[string]AlertIfShortcut

GetShortcuts returns shortcuts from a YAML file

Types

type AlertIfShortcut

type AlertIfShortcut struct {
	Expanded    string            `yaml:"expanded"`
	Annotations map[string]string `yaml:"annotations"`
	Labels      map[string]string `yaml:"labels"`
}

AlertIfShortcut defines how to expand a alertIf shortcut

Jump to

Keyboard shortcuts

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