Documentation ¶
Index ¶
- Constants
- type AWSCollectorPlugin
- type AWSSQSCollector
- type CollectedMetric
- type Collector
- type CollectorFactory
- func (c *CollectorFactory) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, ...) (Collector, error)
- func (c *CollectorFactory) RegisterExternalCollector(metrics []string, plugin CollectorPlugin)
- func (c *CollectorFactory) RegisterObjectCollector(kind, metricCollector string, plugin CollectorPlugin) error
- func (c *CollectorFactory) RegisterPodsCollector(metricCollector string, plugin CollectorPlugin) error
- type CollectorPlugin
- type JSONPathMetricsGetter
- type MaxWeightedCollector
- type MetricConfig
- type MetricTypeName
- type NoResultError
- type ObjectReference
- type PodCollector
- type PodCollectorPlugin
- type PodMetricsGetter
- type PrometheusCollector
- type PrometheusCollectorPlugin
- type SkipperCollector
- type SkipperCollectorPlugin
- type ZMONCollector
- type ZMONCollectorPlugin
Constants ¶
const (
AWSSQSQueueLengthMetric = "sqs-queue-length"
)
const (
PrometheusMetricName = "prometheus-query"
)
const ( // ZMONCheckMetric defines the metric name for metrics based on ZMON // checks. ZMONCheckMetric = "zmon-check" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSCollectorPlugin ¶
type AWSCollectorPlugin struct {
// contains filtered or unexported fields
}
func NewAWSCollectorPlugin ¶
func NewAWSCollectorPlugin(sessions map[string]*session.Session) *AWSCollectorPlugin
func (*AWSCollectorPlugin) NewCollector ¶
func (c *AWSCollectorPlugin) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
NewCollector initializes a new skipper collector from the specified HPA.
type AWSSQSCollector ¶
type AWSSQSCollector struct {
// contains filtered or unexported fields
}
func NewAWSSQSCollector ¶
func NewAWSSQSCollector(sessions map[string]*session.Session, config *MetricConfig, interval time.Duration) (*AWSSQSCollector, error)
func (*AWSSQSCollector) GetMetrics ¶
func (c *AWSSQSCollector) GetMetrics() ([]CollectedMetric, error)
func (*AWSSQSCollector) Interval ¶
func (c *AWSSQSCollector) Interval() time.Duration
Interval returns the interval at which the collector should run.
type CollectedMetric ¶
type CollectedMetric struct { Type autoscalingv2.MetricSourceType Custom custom_metrics.MetricValue External external_metrics.ExternalMetricValue }
type Collector ¶
type Collector interface { GetMetrics() ([]CollectedMetric, error) Interval() time.Duration }
type CollectorFactory ¶
type CollectorFactory struct {
// contains filtered or unexported fields
}
func NewCollectorFactory ¶
func NewCollectorFactory() *CollectorFactory
func (*CollectorFactory) NewCollector ¶
func (c *CollectorFactory) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
func (*CollectorFactory) RegisterExternalCollector ¶
func (c *CollectorFactory) RegisterExternalCollector(metrics []string, plugin CollectorPlugin)
func (*CollectorFactory) RegisterObjectCollector ¶
func (c *CollectorFactory) RegisterObjectCollector(kind, metricCollector string, plugin CollectorPlugin) error
func (*CollectorFactory) RegisterPodsCollector ¶
func (c *CollectorFactory) RegisterPodsCollector(metricCollector string, plugin CollectorPlugin) error
type CollectorPlugin ¶
type CollectorPlugin interface {
NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
}
type JSONPathMetricsGetter ¶
type JSONPathMetricsGetter struct {
// contains filtered or unexported fields
}
JSONPathMetricsGetter is a metrics getter which looks up pod metrics by querying the pods metrics endpoint and lookup the metric value as defined by the json path query.
func NewJSONPathMetricsGetter ¶
func NewJSONPathMetricsGetter(config map[string]string) (*JSONPathMetricsGetter, error)
NewJSONPathMetricsGetter initializes a new JSONPathMetricsGetter.
type MaxWeightedCollector ¶
type MaxWeightedCollector struct {
// contains filtered or unexported fields
}
MaxWeightedCollector is a simple aggregator collector that returns the maximum value of metrics from all collectors.
func NewMaxWeightedCollector ¶
func NewMaxWeightedCollector(interval time.Duration, weight float64, collectors ...Collector) *MaxWeightedCollector
NewMaxWeightedCollector initializes a new MaxWeightedCollector.
func (*MaxWeightedCollector) GetMetrics ¶
func (c *MaxWeightedCollector) GetMetrics() ([]CollectedMetric, error)
GetMetrics gets metrics from all collectors and return the higest value.
func (*MaxWeightedCollector) Interval ¶
func (c *MaxWeightedCollector) Interval() time.Duration
Interval returns the interval at which the collector should run.
type MetricConfig ¶
type MetricConfig struct { MetricTypeName CollectorName string Config map[string]string ObjectReference custom_metrics.ObjectReference PerReplica bool Interval time.Duration }
func ParseHPAMetrics ¶
func ParseHPAMetrics(hpa *autoscalingv2.HorizontalPodAutoscaler) ([]*MetricConfig, error)
ParseHPAMetrics parses the HPA object into a list of metric configurations.
type MetricTypeName ¶
type MetricTypeName struct { Type autoscalingv2.MetricSourceType Metric autoscalingv2.MetricIdentifier }
type NoResultError ¶
type NoResultError struct {
// contains filtered or unexported fields
}
func (NoResultError) Error ¶
func (r NoResultError) Error() string
type ObjectReference ¶
type ObjectReference struct { autoscalingv2.CrossVersionObjectReference Namespace string }
type PodCollector ¶
type PodCollector struct { Getter PodMetricsGetter // contains filtered or unexported fields }
func NewPodCollector ¶
func NewPodCollector(client kubernetes.Interface, hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (*PodCollector, error)
func (*PodCollector) GetMetrics ¶
func (c *PodCollector) GetMetrics() ([]CollectedMetric, error)
func (*PodCollector) Interval ¶
func (c *PodCollector) Interval() time.Duration
type PodCollectorPlugin ¶
type PodCollectorPlugin struct {
// contains filtered or unexported fields
}
func NewPodCollectorPlugin ¶
func NewPodCollectorPlugin(client kubernetes.Interface) *PodCollectorPlugin
func (*PodCollectorPlugin) NewCollector ¶
func (p *PodCollectorPlugin) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
type PodMetricsGetter ¶
type PrometheusCollector ¶
type PrometheusCollector struct {
// contains filtered or unexported fields
}
func NewPrometheusCollector ¶
func NewPrometheusCollector(client kubernetes.Interface, promAPI promv1.API, hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (*PrometheusCollector, error)
func (*PrometheusCollector) GetMetrics ¶
func (c *PrometheusCollector) GetMetrics() ([]CollectedMetric, error)
func (*PrometheusCollector) Interval ¶
func (c *PrometheusCollector) Interval() time.Duration
type PrometheusCollectorPlugin ¶
type PrometheusCollectorPlugin struct {
// contains filtered or unexported fields
}
func NewPrometheusCollectorPlugin ¶
func NewPrometheusCollectorPlugin(client kubernetes.Interface, prometheusServer string) (*PrometheusCollectorPlugin, error)
func (*PrometheusCollectorPlugin) NewCollector ¶
func (p *PrometheusCollectorPlugin) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
type SkipperCollector ¶
type SkipperCollector struct {
// contains filtered or unexported fields
}
SkipperCollector is a metrics collector for getting skipper ingress metrics. It depends on the prometheus collector for getting the metrics.
func NewSkipperCollector ¶
func NewSkipperCollector(client kubernetes.Interface, plugin CollectorPlugin, hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration, backendAnnotations []string, backend string) (*SkipperCollector, error)
NewSkipperCollector initializes a new SkipperCollector.
func (*SkipperCollector) GetMetrics ¶
func (c *SkipperCollector) GetMetrics() ([]CollectedMetric, error)
GetMetrics gets skipper metrics from prometheus.
func (*SkipperCollector) Interval ¶
func (c *SkipperCollector) Interval() time.Duration
Interval returns the interval at which the collector should run.
type SkipperCollectorPlugin ¶
type SkipperCollectorPlugin struct {
// contains filtered or unexported fields
}
SkipperCollectorPlugin is a collector plugin for initializing metrics collectors for getting skipper ingress metrics.
func NewSkipperCollectorPlugin ¶
func NewSkipperCollectorPlugin(client kubernetes.Interface, prometheusPlugin *PrometheusCollectorPlugin, backendAnnotations []string) (*SkipperCollectorPlugin, error)
NewSkipperCollectorPlugin initializes a new SkipperCollectorPlugin.
func (*SkipperCollectorPlugin) NewCollector ¶
func (c *SkipperCollectorPlugin) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
NewCollector initializes a new skipper collector from the specified HPA.
type ZMONCollector ¶
type ZMONCollector struct {
// contains filtered or unexported fields
}
ZMONCollector defines a collector that is able to collect metrics from ZMON.
func NewZMONCollector ¶
func NewZMONCollector(zmon zmon.ZMON, config *MetricConfig, annotations map[string]string, interval time.Duration) (*ZMONCollector, error)
NewZMONCollector initializes a new ZMONCollector.
func (*ZMONCollector) GetMetrics ¶
func (c *ZMONCollector) GetMetrics() ([]CollectedMetric, error)
GetMetrics returns a list of collected metrics for the ZMON check.
func (*ZMONCollector) Interval ¶
func (c *ZMONCollector) Interval() time.Duration
Interval returns the interval at which the collector should run.
type ZMONCollectorPlugin ¶
type ZMONCollectorPlugin struct {
// contains filtered or unexported fields
}
ZMONCollectorPlugin defines a plugin for creating collectors that can get metrics from ZMON.
func NewZMONCollectorPlugin ¶
func NewZMONCollectorPlugin(zmon zmon.ZMON) (*ZMONCollectorPlugin, error)
NewZMONCollectorPlugin initializes a new ZMONCollectorPlugin.
func (*ZMONCollectorPlugin) NewCollector ¶
func (c *ZMONCollectorPlugin) NewCollector(hpa *autoscalingv2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
NewCollector initializes a new ZMON collector from the specified HPA.