Documentation
¶
Index ¶
- Constants
- Variables
- func GetPersistentVolumeLabels(pv v1.PersistentVolumeSource, labels map[string]string)
- func MetricsData(logger *zap.Logger, summary *stats.Summary, metadata Metadata, typeStr string, ...) []consumerdata.MetricsData
- func ValidateMetadataLabelsConfig(labels []MetadataLabel) error
- type Client
- type ClientConfig
- type ClientProvider
- type HTTPRestClient
- type Metadata
- type MetadataLabel
- type MetadataProvider
- type MetricGroup
- type RestClient
- type StatsProvider
Constants ¶
const ( ContainerMetricGroup = MetricGroup("container") PodMetricGroup = MetricGroup("pod") NodeMetricGroup = MetricGroup("node") VolumeMetricGroup = MetricGroup("volume") )
Variables ¶
var ValidMetricGroups = map[MetricGroup]bool{ ContainerMetricGroup: true, PodMetricGroup: true, NodeMetricGroup: true, VolumeMetricGroup: true, }
Functions ¶
func GetPersistentVolumeLabels ¶ added in v0.9.0
func GetPersistentVolumeLabels(pv v1.PersistentVolumeSource, labels map[string]string)
func MetricsData ¶
func MetricsData( logger *zap.Logger, summary *stats.Summary, metadata Metadata, typeStr string, metricGroupsToCollect map[MetricGroup]bool) []consumerdata.MetricsData
func ValidateMetadataLabelsConfig ¶ added in v0.7.0
func ValidateMetadataLabelsConfig(labels []MetadataLabel) error
ValidateMetadataLabelsConfig validates that provided list of metadata labels is supported
Types ¶
type ClientConfig ¶
type ClientConfig struct { k8sconfig.APIConfig `mapstructure:",squash"` configtls.TLSSetting `mapstructure:",squash"` // InsecureSkipVerify controls whether the client verifies the server's // certificate chain and host name. InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"` }
Config for a kubelet client for talking to a kubelet HTTP endpoint.
type ClientProvider ¶ added in v0.5.0
func NewClientProvider ¶ added in v0.5.0
func NewClientProvider(endpoint string, cfg *ClientConfig, logger *zap.Logger) (ClientProvider, error)
type HTTPRestClient ¶
type HTTPRestClient struct {
// contains filtered or unexported fields
}
RestClient is a thin wrapper around a kubelet client, encapsulating endpoints and their corresponding http methods. The endpoints /stats/container /spec/ are excluded because they require cadvisor. The /metrics endpoint is excluded because it returns Prometheus data.
func NewRestClient ¶
func NewRestClient(client Client) *HTTPRestClient
func (*HTTPRestClient) Pods ¶
func (c *HTTPRestClient) Pods() ([]byte, error)
func (*HTTPRestClient) StatsSummary ¶
func (c *HTTPRestClient) StatsSummary() ([]byte, error)
type Metadata ¶ added in v0.7.0
type Metadata struct { Labels map[MetadataLabel]bool PodsMetadata *v1.PodList DetailedPVCLabelsSetter func(volCacheID, volumeClaim, namespace string, labels map[string]string) error }
func NewMetadata ¶ added in v0.7.0
type MetadataLabel ¶ added in v0.7.0
type MetadataLabel string
const ( MetadataLabelContainerID MetadataLabel = conventions.AttributeContainerID MetadataLabelVolumeType MetadataLabel = labelVolumeType )
type MetadataProvider ¶ added in v0.7.0
type MetadataProvider struct {
// contains filtered or unexported fields
}
MetadataProvider wraps a RestClient, returning an unmarshaled metadata.
func NewMetadataProvider ¶ added in v0.7.0
func NewMetadataProvider(rc RestClient) *MetadataProvider
type MetricGroup ¶ added in v0.8.0
type MetricGroup string
type RestClient ¶
RestClient is swappable for testing.
type StatsProvider ¶
type StatsProvider struct {
// contains filtered or unexported fields
}
StatsProvider wraps a RestClient, returning an unmarshaled stats.Summary struct from the kubelet API.
func NewStatsProvider ¶
func NewStatsProvider(rc RestClient) *StatsProvider
func (*StatsProvider) StatsSummary ¶
func (p *StatsProvider) StatsSummary() (*stats.Summary, error)
StatsSummary calls the /stats/summary kubelet endpoint and unmarshals the results into a stats.Summary struct.