prometheus

package
v0.0.0-...-b1121b5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 35 Imported by: 6

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

How to measure the Latency of metrics-server

Make sure to configure the following flags

  • --provider=gce
  • --enable-prometheus-server=true
  • --prometheus-scrape-metrics-server=true

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 ValidatePrometheusFlags

func ValidatePrometheusFlags(p *config.PrometheusConfig) *clerrors.ErrorList

ValidatePrometheusFlags validates prometheus flags.

func VerifySnapshotName

func VerifySnapshotName(name string) error

VerifySnapshotName verifies if snapshot name statisfies snapshot name regex.

Types

type Controller

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

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

func NewController

func NewController(clusterLoaderConfig *config.ClusterLoaderConfig) (pc *Controller, err error)

NewController creates a new instance of Controller for the given config.

func (*Controller) EnableTearDownPrometheusStackOnInterrupt

func (pc *Controller) EnableTearDownPrometheusStackOnInterrupt()

func (*Controller) GetFramework

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

GetFramework returns prometheus framework.

func (*Controller) MakePrometheusSnapshotIfEnabled

func (pc *Controller) MakePrometheusSnapshotIfEnabled() error

func (*Controller) SetUpPrometheusStack

func (pc *Controller) 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 (*Controller) TearDownPrometheusStack

func (pc *Controller) 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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