Documentation ¶
Index ¶
- Constants
- Variables
- func AddK8sTags(tags map[string]string)
- func ConvertPodPhase(phase kube_api.PodPhase) int64
- 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 GetServiceLister(kubeClient kubernetes.Interface) (v1listers.ServiceLister, error)
- func NewDummyMetricsSourceProvider(name string, collectionIterval, timeout time.Duration, ...) metrics.SourceProvider
- 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
Constants ¶
View Source
const ( NodeNameEnvVar = "POD_NODE_NAME" NamespaceNameEnvVar = "POD_NAMESPACE_NAME" InstallationMethodEnvVar = "INSTALLATION_METHOD" 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 )
Variables ¶
View Source
var ( // NeverStop may be passed to make it never stop NeverStop <-chan struct{} = make(chan struct{}) )
Functions ¶
func AddK8sTags ¶ added in v1.11.0
func ConvertPodPhase ¶ added in v1.10.0
func GetFieldSelector ¶ added in v0.9.8
func GetInstallationMethod ¶ added in v1.7.1
func GetInstallationMethod() string
func GetKubernetesProvider ¶ added in v1.11.0
func GetKubernetesProvider() string
func GetKubernetesVersion ¶ added in v1.11.0
func GetKubernetesVersion() string
func GetNamespaceName ¶ added in v0.9.8
func GetNamespaceName() string
func GetNamespaceStore ¶ added in v1.0.0
func GetNamespaceStore(kubeClient kubernetes.Interface) cache.Store
func GetNodeHostnameAndIP ¶ added in v1.0.0
func GetNodeLister ¶
func GetNodeLister(kubeClient kubernetes.Interface) (v1listers.NodeLister, *cache.Reflector, error)
func GetNodeName ¶ added in v0.9.8
func GetNodeName() string
func GetNodeRole ¶ added in v1.9.0
func GetPodLister ¶
func GetPodLister(kubeClient kubernetes.Interface) (v1listers.PodLister, error)
func GetServiceLister ¶ added in v0.9.4
func GetServiceLister(kubeClient kubernetes.Interface) (v1listers.ServiceLister, error)
func Retry ¶ added in v1.11.0
TODO: this needs a test! Tricky... Retry makes the function run infinitely after certain time period
func ScrapeAnyNodes ¶ added in v1.12.0
func ScrapeAnyNodes() bool
func ScrapeCluster ¶ added in v1.12.0
func ScrapeCluster() bool
func ScrapeOnlyOwnNode ¶ added in v1.12.0
func ScrapeOnlyOwnNode() bool
func SetAgentType ¶ added in v1.12.0
func SetAgentType(value AgentType)
func SetKubernetesProvider ¶ added in v1.11.0
func SetKubernetesProvider(providerID string)
func SetKubernetesVersion ¶ added in v1.11.0
func SetKubernetesVersion(version string)
Types ¶
type ConfigHandler ¶ added in v1.0.0
type ConfigHandler interface {
Handle(cfg interface{})
}
type ContainerStateInfo ¶ added in v1.10.0
func NewContainerStateInfo ¶ added in v1.10.0
func NewContainerStateInfo(state kube_api.ContainerState) ContainerStateInfo
func (ContainerStateInfo) AddMetricTags ¶ added in v1.10.0
func (csi ContainerStateInfo) AddMetricTags(tags map[string]string)
func (ContainerStateInfo) IsKnownState ¶ added in v1.10.0
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 ¶ added in v1.8.0
func NewDummyMetricsSourceWithError(name string, latency time.Duration, autoDiscovered bool) *DummyMetricsSource
func (*DummyMetricsSource) AutoDiscovered ¶ added in v1.8.0
func (dummy *DummyMetricsSource) AutoDiscovered() bool
func (*DummyMetricsSource) Cleanup ¶ added in v1.2.4
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (dummy *DummyMetricsSourceProvider) Timeout() time.Duration
type DummyProviderHandler ¶ added in v0.9.4
type DummyProviderHandler struct {
// contains filtered or unexported fields
}
func NewDummyProviderHandler ¶ added in v1.3.0
func NewDummyProviderHandler(count int) *DummyProviderHandler
func (*DummyProviderHandler) AddProvider ¶ added in v0.9.4
func (d *DummyProviderHandler) AddProvider(provider metrics.SourceProvider)
func (*DummyProviderHandler) DeleteProvider ¶ added in v0.9.4
func (d *DummyProviderHandler) DeleteProvider(name string)
type DummySink ¶
type DummySink struct {
// contains filtered or unexported fields
}
func (*DummySink) ExportEvent ¶ added in v1.0.4
func (*DummySink) GetExportCount ¶
type FileListener ¶ added in v1.0.0
type FileListener interface {
Changed(file string)
}
type FileWatcher ¶ added in v1.0.0
type FileWatcher interface { Watch() Stop() }
func NewFileWatcher ¶ added in v1.0.0
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 ¶ added in v1.3.1
What is an interner? Is that a thing? Good question, here's a good description https://en.wikipedia.org/wiki/String_interning
func NewStringInterner ¶ added in v1.3.1
func NewStringInterner() StringInterner
func (StringInterner) Intern ¶ added in v1.3.1
func (interner StringInterner) Intern(s string) *string
Click to show internal directories.
Click to hide internal directories.