Documentation ¶
Index ¶
- Variables
- type Builder
- func (b *Builder) Build() []MetricsCollector
- func (b *Builder) WithApiserver(apiserver string) *Builder
- func (b *Builder) WithEnabledCollectors(c []string) *Builder
- func (b *Builder) WithHubType(hubType string) *Builder
- func (b *Builder) WithKubeConfig(kubeconfig string) *Builder
- func (b *Builder) WithNamespaces(n options.NamespaceList) *Builder
- func (b *Builder) WithWhiteBlackList(l whiteBlackLister) *Builder
- type CounterMetricsStore
- func (s *CounterMetricsStore) Add(obj interface{}) error
- func (s *CounterMetricsStore) Delete(obj interface{}) error
- func (s *CounterMetricsStore) Get(obj interface{}) (item interface{}, exists bool, err error)
- func (s *CounterMetricsStore) GetByKey(key string) (item interface{}, exists bool, err error)
- func (s *CounterMetricsStore) List() []interface{}
- func (s *CounterMetricsStore) ListKeys() []string
- func (s *CounterMetricsStore) Replace(list []interface{}, _ string) error
- func (s *CounterMetricsStore) Resync() error
- func (s *CounterMetricsStore) Update(obj interface{}) error
- func (s *CounterMetricsStore) WriteAll(w io.Writer)
- type MetricsCollector
Constants ¶
This section is empty.
Variables ¶
var ( ScrapeErrorTotalMetric = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "ksm_scrape_error_total", Help: "Total scrape errors encountered when scraping a resource", }, []string{"resource"}, ) ResourcesPerScrapeMetric = prometheus.NewSummaryVec( prometheus.SummaryOpts{ Name: "ksm_resources_per_scrape", Help: "Number of resources returned per scrape", }, []string{"resource"}, ) )
var ResyncPeriod = 60 * time.Minute
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder helps to build collectors. It follows the builder pattern (https://en.wikipedia.org/wiki/Builder_pattern).
func (*Builder) Build ¶
func (b *Builder) Build() []MetricsCollector
Build initializes and registers all enabled collectors.
func (*Builder) WithApiserver ¶
func (*Builder) WithEnabledCollectors ¶
WithEnabledCollectors sets the enabledCollectors property of a Builder.
func (*Builder) WithHubType ¶
func (*Builder) WithKubeConfig ¶
func (*Builder) WithNamespaces ¶
func (b *Builder) WithNamespaces(n options.NamespaceList) *Builder
WithNamespaces sets the namespaces property of a Builder.
func (*Builder) WithWhiteBlackList ¶
WithWhiteBlackList configures the white or blacklisted metrics to be exposed by the collectors build by the Builder
type CounterMetricsStore ¶
type CounterMetricsStore struct {
// contains filtered or unexported fields
}
CounterMetricsStore implements the k8s.io/client-go/tools/cache.Store interface. Instead of storing entire Kubernetes objects, it stores UID of those objects, which can be used to caculate the number of the stored objects.
func (*CounterMetricsStore) Add ¶
func (s *CounterMetricsStore) Add(obj interface{}) error
Add implements the Add method of the store interface.
func (*CounterMetricsStore) Delete ¶
func (s *CounterMetricsStore) Delete(obj interface{}) error
Delete implements the Delete method of the store interface.
func (*CounterMetricsStore) Get ¶
func (s *CounterMetricsStore) Get(obj interface{}) (item interface{}, exists bool, err error)
Get implements the Get method of the store interface.
func (*CounterMetricsStore) GetByKey ¶
func (s *CounterMetricsStore) GetByKey(key string) (item interface{}, exists bool, err error)
GetByKey implements the GetByKey method of the store interface.
func (*CounterMetricsStore) List ¶
func (s *CounterMetricsStore) List() []interface{}
List implements the List method of the store interface.
func (*CounterMetricsStore) ListKeys ¶
func (s *CounterMetricsStore) ListKeys() []string
ListKeys implements the ListKeys method of the store interface.
func (*CounterMetricsStore) Replace ¶
func (s *CounterMetricsStore) Replace(list []interface{}, _ string) error
Add implements the Add method of the store interface.
func (*CounterMetricsStore) Resync ¶
func (s *CounterMetricsStore) Resync() error
Resync implements the Resync method of the store interface.
func (*CounterMetricsStore) Update ¶
func (s *CounterMetricsStore) Update(obj interface{}) error
Update implements the Update method of the store interface.
func (*CounterMetricsStore) WriteAll ¶
func (s *CounterMetricsStore) WriteAll(w io.Writer)
WriteAll writes all metrics of the store into the given writer, zipped with the help text of each metric family.