prometheus

package
v0.0.0-...-0f57273 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

README

Prometheus

Prometheus stack in ClusterLoader2 framework.

How to connect to Prometheus UI

  1. kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090 --address=0.0.0.0
  2. Visit http://localhost:9090

How to connect to Grafana UI

  1. kubectl --namespace monitoring port-forward svc/grafana 3000 --address=0.0.0.0
  2. Visit http://localhost:3000
  3. Login/password: admin/admin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAllTargetsReady

func CheckAllTargetsReady(k8sClient kubernetes.Interface, selector func(Target) bool, minActiveTargets int) (bool, error)

CheckAllTargetsReady returns true iff there is at least minActiveTargets matching the selector and all of them are ready.

func CheckTargetsReady

func CheckTargetsReady(k8sClient kubernetes.Interface, selector func(Target) bool, minActiveTargets, minReadyTargets int) (bool, error)

CheckTargetsReady returns true iff there is at least minActiveTargets matching the selector and at least minReadyTargets of them are ready.

func InitFlags

func InitFlags(p *config.PrometheusConfig)

InitFlags initializes prometheus flags.

func VerifySnapshotName

func VerifySnapshotName(name string) error

VerifySnapshotName verifies if snapshot name statisfies snapshot name regex.

Types

type PrometheusController

type PrometheusController struct {
	// contains filtered or unexported fields
}

PrometheusController is a util for managing (setting up / tearing down) the prometheus stack in the cluster.

func NewPrometheusController

func NewPrometheusController(clusterLoaderConfig *config.ClusterLoaderConfig) (pc *PrometheusController, err error)

NewPrometheusController creates a new instance of PrometheusController for the given config.

func (*PrometheusController) GetFramework

func (pc *PrometheusController) GetFramework() *framework.Framework

GetFramework returns prometheus framework.

func (*PrometheusController) SetUpPrometheusStack

func (pc *PrometheusController) SetUpPrometheusStack() error

SetUpPrometheusStack sets up prometheus stack in the cluster. This method is idempotent, if the prometheus stack is already set up applying the manifests again will be no-op.

func (*PrometheusController) TearDownPrometheusStack

func (pc *PrometheusController) TearDownPrometheusStack() error

TearDownPrometheusStack tears down prometheus stack, releasing all prometheus resources.

type Target

type Target struct {
	Labels map[string]string `json:"labels"`
	Health string            `json:"health"`
}

Target represents a Prometheus target object.

Jump to

Keyboard shortcuts

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