discovery

package
v1.27.0-alpha.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBcsModuleLabelKey label key
	DefaultBcsModuleLabelKey = "bcs_module"
	// DiscoveryFileName promethus file name
	DiscoveryFileName = "_sd_config.json"
)
View Source
const (
	// CadvisorModule name
	CadvisorModule = "cadvisor"
	// NodeexportModule name
	NodeexportModule = "node_export"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	// Start TODO
	// start
	Start() error

	// GetPrometheusSdConfig TODO
	// get prometheus service discovery config
	GetPrometheusSdConfig(module string) ([]*types.PrometheusSdConfig, error)

	// GetPromSdConfigFile TODO
	// get prometheus sd config file path
	GetPromSdConfigFile(module string) string

	// RegisterEventFunc TODO
	// register event handle function
	RegisterEventFunc(handleFunc EventHandleFunc)
}

Discovery interface for prometheus discovery

func NewBcsDiscovery

func NewBcsDiscovery(zkAddr string, promFilePrefix string, module []string) (Discovery, error)

NewBcsDiscovery new bcs module service discovery

func NewNodeEtcdDiscovery

func NewNodeEtcdDiscovery(kubeconfig string, promFilePrefix, module string, cadvisorPort,
	nodeExportPort int) (Discovery, error)

NewNodeEtcdDiscovery new nodeEtcdDiscovery for discovery node cadvisor targets

func NewNodeZkDiscovery

func NewNodeZkDiscovery(zkAddr []string, promFilePrefix, module string, cadvisorPort, nodeExportPort int) (Discovery,
	error)

NewNodeZkDiscovery new nodeZkDiscovery for discovery node cadvisor targets

func NewServiceMonitor

func NewServiceMonitor(kubeconfig string, promFilePrefix, module string) (Discovery, error)

NewServiceMonitor new serviceMonitor for discovery node cadvisor targets

type EventHandleFunc

type EventHandleFunc func(dInfo Info)

EventHandleFunc event handler for callback

type Info

type Info struct {
	// mesosModules: commtypes.BCS_MODULE_SCHEDULER, commtypes.BCS_MODULE_MESOSDATAWATCH ...
	// serviceModules: commtypes.BCS_MODULE_APISERVER, commtypes.BCS_MODULE_STORAGE, commtypes.BCS_MODULE_NETSERVICE ...
	// nodeModules: discovery.CadvisorModule, discovery.NodeexportModule
	// serviceMonitor: ServiceMonitor
	Module string
	// changed key
	Key string
}

Info information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL