Documentation ¶
Index ¶
- Constants
- Variables
- func AddK8sTags(tags map[string]string)
- func ClusterCollector() bool
- func ConditionStatusFloat64(status kube_api.ConditionStatus) float64
- func ConvertPVCPhase(phase kube_api.PersistentVolumeClaimPhase) int64
- func ConvertPVPhase(phase kube_api.PersistentVolumePhase) int64
- func ConvertPodPhase(phase kube_api.PodPhase) int64
- func GetClusterUUID() string
- func GetExternalEndpointAccessKey() string
- func GetFieldSelector(resourceType string) fields.Selector
- func GetInstallationMethod() string
- func GetKubernetesProvider() string
- func GetKubernetesVersion() string
- func GetNamespaceName() string
- func GetNamespaceStore(kubeClient kubernetes.Interface) cache.Store
- func GetNodeHostnameAndIP(node *kube_api.Node) (string, net.IP, error)
- func GetNodeLister(kubeClient kubernetes.Interface) (v1listers.NodeLister, *cache.Reflector, error)
- func GetNodeName() string
- func GetNodeRole(node *kube_api.Node) string
- func GetPodLister(kubeClient kubernetes.Interface) (v1listers.PodLister, error)
- func GetPodStuckInTerminating() *v1.Pod
- func GetServiceLister(kubeClient kubernetes.Interface) (v1listers.ServiceLister, error)
- func HasOwnerReference(ownerReferences []metav1.OwnerReference) bool
- func IsStuckInTerminating(pod *v1.Pod) bool
- func JobConditionIsFailed(condition batchv1.JobCondition) bool
- func NewDummyMetricsSourceProvider(name string, collectionIterval, timeout time.Duration, ...) metrics.SourceProvider
- func PodConditionIsUnchedulable(condition kube_api.PodCondition) bool
- func Retry(f func(), duration time.Duration, stopCh <-chan struct{})
- func ScrapeAnyNodes() bool
- func ScrapeCluster() bool
- func ScrapeOnlyOwnNode() bool
- func SetAgentType(value AgentType)
- func SetKubernetesProvider(providerID string)
- func SetKubernetesVersion(version string)
- type AgentType
- type ConfigHandler
- type ContainerStateInfo
- type DummyDataProcessor
- type DummyMetricsSource
- type DummyMetricsSourceProvider
- type DummyProviderHandler
- type DummySink
- type FileListener
- type FileWatcher
- type LabelCopier
- type StringInterner
- type WorkloadCache
Constants ¶
View Source
const ( NodeNameEnvVar = "POD_NODE_NAME" NamespaceNameEnvVar = "POD_NAMESPACE_NAME" InstallationMethodEnvVar = "INSTALLATION_METHOD" ClusterUUIDEnvVar = "CLUSTER_UUID" ExternalEndpointAccessKeyEnvVar = "K8S_EVENTS_ENDPOINT_TOKEN" ForceGC = "FORCE_GC" KubernetesVersionEnvVar = "KUBERNETES_VERSION" KubernetesProviderEnvVar = "KUBERNETES_PROVIDER" )
View Source
const ( POD_PHASE_PENDING = iota + 1 POD_PHASE_RUNNING POD_PHASE_SUCCEEDED POD_PHASE_FAILED POD_PHASE_UNKNOWN )
View Source
const ( CONTAINER_STATE_RUNNING = iota + 1 CONTAINER_STATE_WAITING CONTAINER_STATE_TERMINATED )
View Source
const ( PVC_PHASE_PENDING = iota + 1 PVC_PHASE_BOUND PVC_PHASE_LOST PVC_PHASE_UNKNOWN )
View Source
const ( PV_PHASE_PENDING = iota + 1 PV_PHASE_AVAILABLE PV_PHASE_BOUND PV_PHASE_RELEASED PV_PHASE_FAILED PV_PHASE_UNKNOWN )
Variables ¶
View Source
var ( // NeverStop may be passed to make it never stop NeverStop <-chan struct{} = make(chan struct{}) )
Functions ¶
func AddK8sTags ¶
func ClusterCollector ¶
func ClusterCollector() bool
func ConditionStatusFloat64 ¶
func ConditionStatusFloat64(status kube_api.ConditionStatus) float64
func ConvertPVCPhase ¶
func ConvertPVCPhase(phase kube_api.PersistentVolumeClaimPhase) int64
func ConvertPVPhase ¶
func ConvertPVPhase(phase kube_api.PersistentVolumePhase) int64
func ConvertPodPhase ¶
func GetClusterUUID ¶
func GetClusterUUID() string
func GetExternalEndpointAccessKey ¶
func GetExternalEndpointAccessKey() string
func GetFieldSelector ¶
func GetInstallationMethod ¶
func GetInstallationMethod() string
func GetKubernetesProvider ¶
func GetKubernetesProvider() string
func GetKubernetesVersion ¶
func GetKubernetesVersion() string
func GetNamespaceName ¶
func GetNamespaceName() string
func GetNamespaceStore ¶
func GetNamespaceStore(kubeClient kubernetes.Interface) cache.Store
func GetNodeLister ¶
func GetNodeLister(kubeClient kubernetes.Interface) (v1listers.NodeLister, *cache.Reflector, error)
func GetNodeName ¶
func GetNodeName() string
func GetNodeRole ¶
func GetPodLister ¶
func GetPodLister(kubeClient kubernetes.Interface) (v1listers.PodLister, error)
func GetServiceLister ¶
func GetServiceLister(kubeClient kubernetes.Interface) (v1listers.ServiceLister, error)
func HasOwnerReference ¶
func HasOwnerReference(ownerReferences []metav1.OwnerReference) bool
func IsStuckInTerminating ¶
func JobConditionIsFailed ¶
func JobConditionIsFailed(condition batchv1.JobCondition) bool
func PodConditionIsUnchedulable ¶
func PodConditionIsUnchedulable(condition kube_api.PodCondition) bool
func Retry ¶
TODO: this needs a test! Tricky... Retry makes the function run infinitely after certain time period
func ScrapeAnyNodes ¶
func ScrapeAnyNodes() bool
func ScrapeCluster ¶
func ScrapeCluster() bool
func ScrapeOnlyOwnNode ¶
func ScrapeOnlyOwnNode() bool
func SetAgentType ¶
func SetAgentType(value AgentType)
func SetKubernetesProvider ¶
func SetKubernetesProvider(providerID string)
func SetKubernetesVersion ¶
func SetKubernetesVersion(version string)
Types ¶
type ConfigHandler ¶
type ConfigHandler interface {
Handle(cfg interface{})
}
type ContainerStateInfo ¶
func NewContainerStateInfo ¶
func NewContainerStateInfo(state kube_api.ContainerState) ContainerStateInfo
func (ContainerStateInfo) AddMetricTags ¶
func (csi ContainerStateInfo) AddMetricTags(tags map[string]string)
func (ContainerStateInfo) IsKnownState ¶
func (csi ContainerStateInfo) IsKnownState() bool
type DummyDataProcessor ¶
type DummyDataProcessor struct {
// contains filtered or unexported fields
}
func NewDummyDataProcessor ¶
func NewDummyDataProcessor(latency time.Duration) *DummyDataProcessor
func (*DummyDataProcessor) Name ¶
func (dummy *DummyDataProcessor) Name() string
type DummyMetricsSource ¶
type DummyMetricsSource struct {
// contains filtered or unexported fields
}
func NewDummyMetricsSource ¶
func NewDummyMetricsSource(name string, latency time.Duration) *DummyMetricsSource
func NewDummyMetricsSourceWithError ¶
func NewDummyMetricsSourceWithError(name string, latency time.Duration, autoDiscovered bool) *DummyMetricsSource
func (*DummyMetricsSource) AutoDiscovered ¶
func (dummy *DummyMetricsSource) AutoDiscovered() bool
func (*DummyMetricsSource) Cleanup ¶
func (src *DummyMetricsSource) Cleanup()
func (*DummyMetricsSource) Name ¶
func (dummy *DummyMetricsSource) Name() string
type DummyMetricsSourceProvider ¶
type DummyMetricsSourceProvider struct {
// contains filtered or unexported fields
}
func (*DummyMetricsSourceProvider) CollectionInterval ¶
func (dummy *DummyMetricsSourceProvider) CollectionInterval() time.Duration
func (*DummyMetricsSourceProvider) GetMetricsSources ¶
func (dummy *DummyMetricsSourceProvider) GetMetricsSources() []metrics.Source
func (*DummyMetricsSourceProvider) Name ¶
func (dummy *DummyMetricsSourceProvider) Name() string
func (*DummyMetricsSourceProvider) Timeout ¶
func (dummy *DummyMetricsSourceProvider) Timeout() time.Duration
type DummyProviderHandler ¶
type DummyProviderHandler struct {
// contains filtered or unexported fields
}
func NewDummyProviderHandler ¶
func NewDummyProviderHandler(count int) *DummyProviderHandler
func (*DummyProviderHandler) AddProvider ¶
func (d *DummyProviderHandler) AddProvider(provider metrics.SourceProvider)
func (*DummyProviderHandler) DeleteProvider ¶
func (d *DummyProviderHandler) DeleteProvider(name string)
type DummySink ¶
type DummySink struct {
// contains filtered or unexported fields
}
func (*DummySink) ExportEvent ¶
func (*DummySink) GetExportCount ¶
type FileListener ¶
type FileListener interface {
Changed(file string)
}
type FileWatcher ¶
type FileWatcher interface { Watch() Stop() }
func NewFileWatcher ¶
func NewFileWatcher(file string, listener FileListener, initialDelay time.Duration) FileWatcher
type LabelCopier ¶
type LabelCopier struct {
// contains filtered or unexported fields
}
LabelCopier maps kubernetes objects' labels to metrics
func NewLabelCopier ¶
func NewLabelCopier(separator string, storedLabels, ignoredLabels []string) (*LabelCopier, error)
NewLabelCopier creates a new instance of LabelCopier type
func (*LabelCopier) Copy ¶
func (copier *LabelCopier) Copy(in map[string]string, out map[string]string)
Copy copies the given set of pod labels into a set of metric labels, using the following logic: - all labels, unless found in ignoredLabels, are concatenated into a Separator-separated key:value pairs and stored under metrics.LabelLabels.Key - labels found in storedLabels are additionally stored under key provided
type StringInterner ¶
What is an interner? Is that a thing? Good question, here's a good description https://en.wikipedia.org/wiki/String_interning
func NewStringInterner ¶
func NewStringInterner() StringInterner
func (StringInterner) Intern ¶
func (interner StringInterner) Intern(s string) *string
type WorkloadCache ¶
type WorkloadCache interface { GetWorkloadForPodName(podName, ns string) (name, kind, nodeName string) GetWorkloadForPod(pod *corev1.Pod) (string, string) GetPod(podName, ns string) (pod *corev1.Pod, err error) }
func GetWorkloadCache ¶
func GetWorkloadCache(kubeClient kubernetes.Interface) (WorkloadCache, error)
func NewWorkloadCache ¶
func NewWorkloadCache(kubeClient kubernetes.Interface) (WorkloadCache, error)
Click to show internal directories.
Click to hide internal directories.