metrics

package
v0.0.0-...-59f47cd Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RootDoc = `` /* 131-byte string literal not displayed */

Variables

View Source
var (
	HpaCurrentPodsNum = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_current_pods_num",
			Help: "Number of current pods by status.",
		},
		baseLabels,
	)

	HpaDesiredPodsNum = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_desired_pods_num",
			Help: "Number of desired pods by status.",
		},
		baseLabels,
	)

	HpaMinPodsNum = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_min_pods_num",
			Help: "Number of min pods by spec.",
		},
		baseLabels,
	)

	HpaMaxPodsNum = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_max_pods_num",
			Help: "Number of max pods by spec.",
		},
		baseLabels,
	)

	HpaLastScaleSecond = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_last_scale_second",
			Help: "Time the scale was last executed.",
		},
		baseLabels,
	)

	HpaCurrentMetricsValue = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_current_metrics_value",
			Help: "Current Metrics Value.",
		},
		append(baseLabels, metricLabels...),
	)

	HpaTargetMetricsValue = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_target_metrics_value",
			Help: "Target Metrics Value.",
		},
		append(baseLabels, metricLabels...),
	)

	HpaAbleToScale = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_able_to_scale",
			Help: "status able to scale from annotation.",
		},
		append(baseLabels, annoLabels...),
	)

	HpaScalingActive = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_scaling_active",
			Help: "status scaling active from annotation.",
		},
		append(baseLabels, annoLabels...),
	)

	HpaScalingLimited = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "hpa_scaling_limited",
			Help: "status scaling limited from annotation.",
		},
		append(baseLabels, annoLabels...),
	)
)
View Source
var Addr = flag.String("listen-address", defaultAddr, "The address to listen on for HTTP requests.")
View Source
var ConditionLogging = flag.Bool("conditionLogging", defaultConditionLogging, "Logging HPA conditions.")
View Source
var LoggingInterval = flag.Int("loggingInterval", defaultLoggingInterval, "Interval to logging HPA conditions.")
View Source
var LoggingTo = flag.String("loggingTo", defaultLoggingTo, "Where to log. (stdout or cwlogs)")
View Source
var MetricsInterval = flag.Int("MetricsInterval", defaultMetricsInterval, "Interval to scrape HPA status.")

Functions

func CheckLogGroup

func CheckLogGroup() error

func GetHpaListV2

func GetHpaListV2() ([]as_v2.HorizontalPodAutoscaler, error)

func HpaConditionJsonString

func HpaConditionJsonString(hpa as_v2.HorizontalPodAutoscaler) string

func MergeLabels

func MergeLabels(m1, m2 map[string]string) map[string]string

func ParseCommonMetrics

func ParseCommonMetrics(m commonMetrics) (float64, prometheus.Labels)

func ParseExternalSpec

func ParseExternalSpec(m *as_v2.ExternalMetricSource) commonMetrics

func ParseExternalStatus

func ParseExternalStatus(m *as_v2.ExternalMetricStatus) commonMetrics

func ParseObjectSpec

func ParseObjectSpec(m *as_v2.ObjectMetricSource) commonMetrics

func ParseObjectStatus

func ParseObjectStatus(m *as_v2.ObjectMetricStatus) commonMetrics

func ParsePodsSpec

func ParsePodsSpec(m *as_v2.PodsMetricSource) commonMetrics

func ParsePodsStatus

func ParsePodsStatus(m *as_v2.PodsMetricStatus) commonMetrics

func ParseResourceSpec

func ParseResourceSpec(m *as_v2.ResourceMetricSource) commonMetrics

func ParseResourceStatus

func ParseResourceStatus(m *as_v2.ResourceMetricStatus) commonMetrics

func PutHPAConditionToCWLog

func PutHPAConditionToCWLog(hpa []as_v2.HorizontalPodAutoscaler) error

func ResetAllMetric

func ResetAllMetric()

func ValidateFlags

func ValidateFlags() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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