prometheus

package
Version: v4.2.733+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PromApplyCmd = &cobra.Command{
		Use:   "prom_apply",
		Short: "prom_apply ",
		Long:  "",
		RunE: func(cmd *cobra.Command, args []string) error {
			InitConfig()
			InitK8SClient()

			ok, missingRulesMap, err := RulesCheck(k8sCli)
			if err != nil {
				return err
			} else if !ok {
				if err = PatchMissingRules(k8sCli, missingRulesMap); err != nil {
					return err
				}
			}

			return nil
		},
	}
)
View Source
var (
	PromCheckCmd = &cobra.Command{
		Use:   "prom_check",
		Short: "prom_check ",
		Long:  "",
		RunE: func(cmd *cobra.Command, args []string) error {
			InitConfig()
			InitK8SClient()

			ok, _, err := RulesCheck(k8sCli)
			if err == nil && !ok {
				logger.Info("some rules are missing and need to patch")
				os.Exit(1)
			}

			return err
		},
	}
)

Functions

func GetK8SClient

func GetK8SClient() client.Client

func InitConfig

func InitConfig()

func InitK8SClient

func InitK8SClient()

func PatchMissingRules

func PatchMissingRules(k8sClient client.Client, missingRulesMap map[string]string) error

func PatchRelabelings

func PatchRelabelings(k8sClient client.Client) error

func RelabelingCheck

func RelabelingCheck(k8sClient client.Client) (bool, error)

func RulesCheck

func RulesCheck(k8sClient client.Client) (bool, map[string]string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL