Version: v1.26.0 Latest Latest

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

Go to latest
Published: Jun 6, 2022 License: MIT Imports: 26 Imported by: 1




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"


This section is empty.


This section is empty.


type Discovery

type Discovery interface {
	Start() error

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

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

	//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