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 HTTPCollector
- type HTTPCollectorPlugin
- type InfluxDBCollector
- type InfluxDBCollectorPlugin
- type MetricConfig
- type MetricTypeName
- type NoResultError
- type ObjectReference
- type PluginNotFoundError
- type PodCollector
- type PodCollectorPlugin
- type PrometheusCollector
- type PrometheusCollectorPlugin
- type SkipperCollector
- type SkipperCollectorPlugin
- type ZMONCollector
- type ZMONCollectorPlugin
Constants ¶
const ( HTTPMetricName = "http" HTTPEndpointAnnotationKey = "endpoint" HTTPJsonPathAnnotationKey = "json-key" )
const (
AWSSQSQueueLengthMetric = "sqs-queue-length"
)
const (
InfluxDBMetricName = "flux-query"
)
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 HTTPCollector ¶ added in v0.1.3
type HTTPCollector struct {
// contains filtered or unexported fields
}
func (*HTTPCollector) GetMetrics ¶ added in v0.1.3
func (c *HTTPCollector) GetMetrics() ([]CollectedMetric, error)
func (*HTTPCollector) Interval ¶ added in v0.1.3
func (c *HTTPCollector) Interval() time.Duration
type HTTPCollectorPlugin ¶ added in v0.1.3
type HTTPCollectorPlugin struct{}
func NewHTTPCollectorPlugin ¶ added in v0.1.3
func NewHTTPCollectorPlugin() (*HTTPCollectorPlugin, error)
func (*HTTPCollectorPlugin) NewCollector ¶ added in v0.1.3
func (p *HTTPCollectorPlugin) NewCollector(_ *v2beta2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
type InfluxDBCollector ¶ added in v0.0.6
type InfluxDBCollector struct {
// contains filtered or unexported fields
}
func NewInfluxDBCollector ¶ added in v0.0.6
func NewInfluxDBCollector(address string, token string, org string, config *MetricConfig, interval time.Duration) (*InfluxDBCollector, error)
func (*InfluxDBCollector) GetMetrics ¶ added in v0.0.6
func (c *InfluxDBCollector) GetMetrics() ([]CollectedMetric, error)
func (*InfluxDBCollector) Interval ¶ added in v0.0.6
func (c *InfluxDBCollector) Interval() time.Duration
type InfluxDBCollectorPlugin ¶ added in v0.0.6
type InfluxDBCollectorPlugin struct {
// contains filtered or unexported fields
}
func NewInfluxDBCollectorPlugin ¶ added in v0.0.6
func NewInfluxDBCollectorPlugin(client kubernetes.Interface, address, token, org string) (*InfluxDBCollectorPlugin, error)
func (*InfluxDBCollectorPlugin) NewCollector ¶ added in v0.0.6
func (p *InfluxDBCollectorPlugin) NewCollector(hpa *v2beta2.HorizontalPodAutoscaler, config *MetricConfig, interval time.Duration) (Collector, error)
type MetricConfig ¶
type MetricConfig struct { MetricTypeName CollectorName string Config map[string]string ObjectReference custom_metrics.ObjectReference PerReplica bool Interval time.Duration MetricSpec autoscalingv2.MetricSpec }
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 PluginNotFoundError ¶ added in v0.1.1
type PluginNotFoundError struct {
// contains filtered or unexported fields
}
func (*PluginNotFoundError) Error ¶ added in v0.1.1
func (p *PluginNotFoundError) Error() string
type PodCollector ¶
type PodCollector struct { Getter httpmetrics.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 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, 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.