Documentation
¶
Index ¶
- func GetConfig(filename string) ([]byte, error)
- type AlertManagerConfig
- type BlackboxConfig
- type DashboardConfig
- type DatasourceConfig
- type GrafanaConfig
- func (c *GrafanaConfig) Config() ([]byte, error)
- func (c *GrafanaConfig) ConfigToFile(file string) error
- func (c *GrafanaConfig) ConfigWithTemplate(tpl string) ([]byte, error)
- func (c *GrafanaConfig) WithAnonymousenable(anonymousEnable bool) *GrafanaConfig
- func (c *GrafanaConfig) WithDefaultTheme(defaultTheme string) *GrafanaConfig
- func (c *GrafanaConfig) WithDomain(domain string) *GrafanaConfig
- func (c *GrafanaConfig) WithOrgName(orgName string) *GrafanaConfig
- func (c *GrafanaConfig) WithOrgRole(orgRole string) *GrafanaConfig
- func (c *GrafanaConfig) WithPassword(passwd string) *GrafanaConfig
- func (c *GrafanaConfig) WithPort(port uint64) *GrafanaConfig
- func (c *GrafanaConfig) WithRootURL(rootURL string) *GrafanaConfig
- func (c *GrafanaConfig) WithUsername(user string) *GrafanaConfig
- type NgMonitoringConfig
- type PrometheusConfig
- func (c *PrometheusConfig) AddAlertmanager(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddBlackbox(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddBlackboxExporter(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddCDC(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddDMMaster(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddDMWorker(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddDrainer(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddGrafana(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddLightning(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddLocalRule(rule string) *PrometheusConfig
- func (c *PrometheusConfig) AddMonitoredServer(ip string) *PrometheusConfig
- func (c *PrometheusConfig) AddNGMonitoring(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddNodeExpoertor(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddPD(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddPump(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddPushgateway(addresses []string) *PrometheusConfig
- func (c *PrometheusConfig) AddTiDB(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddTiFlash(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddTiFlashLearner(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddTiKV(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddTiKVCDC(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) AddTiProxy(ip string, port uint64) *PrometheusConfig
- func (c *PrometheusConfig) Config() ([]byte, error)
- func (c *PrometheusConfig) ConfigToFile(file string) error
- func (c *PrometheusConfig) ConfigWithTemplate(tpl string) ([]byte, error)
- func (c *PrometheusConfig) SetRemoteConfig(cfg string) *PrometheusConfig
- type TiSparkConfig
- func (c *TiSparkConfig) Config() ([]byte, error)
- func (c *TiSparkConfig) ConfigToFile(file string) error
- func (c *TiSparkConfig) ConfigWithTemplate(tpl string) ([]byte, error)
- func (c *TiSparkConfig) WithCustomFields(m map[string]any) *TiSparkConfig
- func (c *TiSparkConfig) WithMasters(masters string) *TiSparkConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlertManagerConfig ¶
type AlertManagerConfig struct{}
AlertManagerConfig represent the data to generate AlertManager config
func NewAlertManagerConfig ¶
func NewAlertManagerConfig() *AlertManagerConfig
NewAlertManagerConfig returns a AlertManagerConfig
func (*AlertManagerConfig) Config ¶
func (c *AlertManagerConfig) Config() ([]byte, error)
Config generate the config file data.
func (*AlertManagerConfig) ConfigToFile ¶
func (c *AlertManagerConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
func (*AlertManagerConfig) ConfigWithTemplate ¶
func (c *AlertManagerConfig) ConfigWithTemplate(tpl string) ([]byte, error)
ConfigWithTemplate generate the AlertManager config content by tpl
type BlackboxConfig ¶
BlackboxConfig represent the data to generate AlertManager config
func NewBlackboxConfig ¶
func NewBlackboxConfig(deployDir string, tlsEnabled bool) *BlackboxConfig
NewBlackboxConfig returns a BlackboxConfig
func (*BlackboxConfig) Config ¶
func (c *BlackboxConfig) Config() ([]byte, error)
Config generate the config file data.
func (*BlackboxConfig) ConfigToFile ¶
func (c *BlackboxConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
func (*BlackboxConfig) ConfigWithTemplate ¶
func (c *BlackboxConfig) ConfigWithTemplate(tpl string) ([]byte, error)
ConfigWithTemplate generate the AlertManager config content by tpl
type DashboardConfig ¶
DashboardConfig represent the data to generate Dashboard config
func NewDashboardConfig ¶
func NewDashboardConfig(cluster, deployDir string) *DashboardConfig
NewDashboardConfig returns a DashboardConfig
func (*DashboardConfig) Config ¶
func (c *DashboardConfig) Config() ([]byte, error)
Config generate the config file data.
func (*DashboardConfig) ConfigToFile ¶
func (c *DashboardConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
func (*DashboardConfig) ConfigWithTemplate ¶
func (c *DashboardConfig) ConfigWithTemplate(tpl string) ([]byte, error)
ConfigWithTemplate generate the Dashboard config content by tpl
type DatasourceConfig ¶
DatasourceConfig represent the data to generate Datasource config
func (*DatasourceConfig) ConfigToFile ¶
func (c *DatasourceConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
type GrafanaConfig ¶
type GrafanaConfig struct { DeployDir string IP string Port uint64 Username string // admin_user Password string // admin_password AnonymousEnable bool // anonymous enable RootURL string // root_url Domain string // domain DefaultTheme string // default_theme OrgName string // org_name OrgRole string // org_role }
GrafanaConfig represent the data to generate Grafana config
func NewGrafanaConfig ¶
func NewGrafanaConfig(ip, deployDir string) *GrafanaConfig
NewGrafanaConfig returns a GrafanaConfig
func (*GrafanaConfig) Config ¶
func (c *GrafanaConfig) Config() ([]byte, error)
Config generate the config file data.
func (*GrafanaConfig) ConfigToFile ¶
func (c *GrafanaConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
func (*GrafanaConfig) ConfigWithTemplate ¶
func (c *GrafanaConfig) ConfigWithTemplate(tpl string) ([]byte, error)
ConfigWithTemplate generate the Grafana config content by tpl
func (*GrafanaConfig) WithAnonymousenable ¶ added in v1.4.0
func (c *GrafanaConfig) WithAnonymousenable(anonymousEnable bool) *GrafanaConfig
WithAnonymousenable sets anonymousEnable of anonymousEnable
func (*GrafanaConfig) WithDefaultTheme ¶ added in v1.6.0
func (c *GrafanaConfig) WithDefaultTheme(defaultTheme string) *GrafanaConfig
WithDefaultTheme sets defaultTheme of default theme
func (*GrafanaConfig) WithDomain ¶ added in v1.4.0
func (c *GrafanaConfig) WithDomain(domain string) *GrafanaConfig
WithDomain sets domain of server domain
func (*GrafanaConfig) WithOrgName ¶ added in v1.6.0
func (c *GrafanaConfig) WithOrgName(orgName string) *GrafanaConfig
WithOrgName sets orgName of org name
func (*GrafanaConfig) WithOrgRole ¶ added in v1.6.0
func (c *GrafanaConfig) WithOrgRole(orgRole string) *GrafanaConfig
WithOrgRole sets orgName of org role
func (*GrafanaConfig) WithPassword ¶ added in v1.3.0
func (c *GrafanaConfig) WithPassword(passwd string) *GrafanaConfig
WithPassword sets password of admin user
func (*GrafanaConfig) WithPort ¶
func (c *GrafanaConfig) WithPort(port uint64) *GrafanaConfig
WithPort set Port field of GrafanaConfig
func (*GrafanaConfig) WithRootURL ¶ added in v1.4.0
func (c *GrafanaConfig) WithRootURL(rootURL string) *GrafanaConfig
WithRootURL sets rootURL of root url
func (*GrafanaConfig) WithUsername ¶ added in v1.3.0
func (c *GrafanaConfig) WithUsername(user string) *GrafanaConfig
WithUsername sets username of admin user
type NgMonitoringConfig ¶ added in v1.7.0
type NgMonitoringConfig struct { ClusterName string Address string AdvertiseAddress string TLSEnabled bool PDAddrs string DeployDir string DataDir string LogDir string }
NgMonitoringConfig represent the data to generate NgMonitoring config
func (*NgMonitoringConfig) ConfigToFile ¶ added in v1.7.0
func (c *NgMonitoringConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
type PrometheusConfig ¶
type PrometheusConfig struct { ClusterName string ScrapeInterval string ScrapeTimeout string TLSEnabled bool NodeExporterAddrs []string TiDBStatusAddrs []string TiProxyStatusAddrs []string TiKVStatusAddrs []string PDAddrs []string TiFlashStatusAddrs []string TiFlashLearnerStatusAddrs []string PumpAddrs []string DrainerAddrs []string CDCAddrs []string TiKVCDCAddrs []string BlackboxExporterAddrs []string LightningAddrs []string MonitoredServers []string AlertmanagerAddrs []string NGMonitoringAddrs []string PushgatewayAddrs []string BlackboxAddr string GrafanaAddr string HasTiKVAccelerateRules bool DMMasterAddrs []string DMWorkerAddrs []string LocalRules []string RemoteConfig string }
PrometheusConfig represent the data to generate Prometheus config
func NewPrometheusConfig ¶
func NewPrometheusConfig(clusterName, clusterVersion string, enableTLS bool) *PrometheusConfig
NewPrometheusConfig returns a PrometheusConfig
func (*PrometheusConfig) AddAlertmanager ¶
func (c *PrometheusConfig) AddAlertmanager(ip string, port uint64) *PrometheusConfig
AddAlertmanager add an alertmanager address
func (*PrometheusConfig) AddBlackbox ¶
func (c *PrometheusConfig) AddBlackbox(ip string, port uint64) *PrometheusConfig
AddBlackbox add an blackbox address
func (*PrometheusConfig) AddBlackboxExporter ¶
func (c *PrometheusConfig) AddBlackboxExporter(ip string, port uint64) *PrometheusConfig
AddBlackboxExporter add a BlackboxExporter address
func (*PrometheusConfig) AddCDC ¶
func (c *PrometheusConfig) AddCDC(ip string, port uint64) *PrometheusConfig
AddCDC add a cdc address
func (*PrometheusConfig) AddDMMaster ¶ added in v1.3.0
func (c *PrometheusConfig) AddDMMaster(ip string, port uint64) *PrometheusConfig
AddDMMaster add an dm-master address
func (*PrometheusConfig) AddDMWorker ¶ added in v1.3.0
func (c *PrometheusConfig) AddDMWorker(ip string, port uint64) *PrometheusConfig
AddDMWorker add an dm-worker address
func (*PrometheusConfig) AddDrainer ¶
func (c *PrometheusConfig) AddDrainer(ip string, port uint64) *PrometheusConfig
AddDrainer add a drainer address
func (*PrometheusConfig) AddGrafana ¶
func (c *PrometheusConfig) AddGrafana(ip string, port uint64) *PrometheusConfig
AddGrafana add an Grafana address
func (*PrometheusConfig) AddLightning ¶
func (c *PrometheusConfig) AddLightning(ip string, port uint64) *PrometheusConfig
AddLightning add a lightning address
func (*PrometheusConfig) AddLocalRule ¶ added in v1.4.0
func (c *PrometheusConfig) AddLocalRule(rule string) *PrometheusConfig
AddLocalRule add a local rule
func (*PrometheusConfig) AddMonitoredServer ¶
func (c *PrometheusConfig) AddMonitoredServer(ip string) *PrometheusConfig
AddMonitoredServer add a MonitoredServer address
func (*PrometheusConfig) AddNGMonitoring ¶ added in v1.9.3
func (c *PrometheusConfig) AddNGMonitoring(ip string, port uint64) *PrometheusConfig
AddNGMonitoring add an ng-monitoring server exporter address
func (*PrometheusConfig) AddNodeExpoertor ¶
func (c *PrometheusConfig) AddNodeExpoertor(ip string, port uint64) *PrometheusConfig
AddNodeExpoertor add a node expoter address
func (*PrometheusConfig) AddPD ¶
func (c *PrometheusConfig) AddPD(ip string, port uint64) *PrometheusConfig
AddPD add a PD address
func (*PrometheusConfig) AddPump ¶
func (c *PrometheusConfig) AddPump(ip string, port uint64) *PrometheusConfig
AddPump add a pump address
func (*PrometheusConfig) AddPushgateway ¶
func (c *PrometheusConfig) AddPushgateway(addresses []string) *PrometheusConfig
AddPushgateway add an pushgateway address
func (*PrometheusConfig) AddTiDB ¶
func (c *PrometheusConfig) AddTiDB(ip string, port uint64) *PrometheusConfig
AddTiDB add a TiDB address
func (*PrometheusConfig) AddTiFlash ¶
func (c *PrometheusConfig) AddTiFlash(ip string, port uint64) *PrometheusConfig
AddTiFlash add a TiFlash address
func (*PrometheusConfig) AddTiFlashLearner ¶
func (c *PrometheusConfig) AddTiFlashLearner(ip string, port uint64) *PrometheusConfig
AddTiFlashLearner add a TiFlash learner address
func (*PrometheusConfig) AddTiKV ¶
func (c *PrometheusConfig) AddTiKV(ip string, port uint64) *PrometheusConfig
AddTiKV add a TiKV address
func (*PrometheusConfig) AddTiKVCDC ¶ added in v1.11.0
func (c *PrometheusConfig) AddTiKVCDC(ip string, port uint64) *PrometheusConfig
AddTiKVCDC add a tikv-cdc address
func (*PrometheusConfig) AddTiProxy ¶ added in v1.14.0
func (c *PrometheusConfig) AddTiProxy(ip string, port uint64) *PrometheusConfig
AddTiProxy add a TiProxy address
func (*PrometheusConfig) Config ¶
func (c *PrometheusConfig) Config() ([]byte, error)
Config generate the config file data.
func (*PrometheusConfig) ConfigToFile ¶
func (c *PrometheusConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
func (*PrometheusConfig) ConfigWithTemplate ¶
func (c *PrometheusConfig) ConfigWithTemplate(tpl string) ([]byte, error)
ConfigWithTemplate generate the Prometheus config content by tpl
func (*PrometheusConfig) SetRemoteConfig ¶ added in v1.4.0
func (c *PrometheusConfig) SetRemoteConfig(cfg string) *PrometheusConfig
SetRemoteConfig set remote read/write config
type TiSparkConfig ¶ added in v1.0.9
TiSparkConfig represent the data to generate TiSpark configs
func NewTiSparkConfig ¶ added in v1.0.9
func NewTiSparkConfig(pds []string) *TiSparkConfig
NewTiSparkConfig returns a TiSparkConfig
func (*TiSparkConfig) Config ¶ added in v1.0.9
func (c *TiSparkConfig) Config() ([]byte, error)
Config generate the config file data.
func (*TiSparkConfig) ConfigToFile ¶ added in v1.0.9
func (c *TiSparkConfig) ConfigToFile(file string) error
ConfigToFile write config content to specific path
func (*TiSparkConfig) ConfigWithTemplate ¶ added in v1.0.9
func (c *TiSparkConfig) ConfigWithTemplate(tpl string) ([]byte, error)
ConfigWithTemplate parses the template file
func (*TiSparkConfig) WithCustomFields ¶ added in v1.0.9
func (c *TiSparkConfig) WithCustomFields(m map[string]any) *TiSparkConfig
WithCustomFields sets custom setting fields
func (*TiSparkConfig) WithMasters ¶ added in v1.0.9
func (c *TiSparkConfig) WithMasters(masters string) *TiSparkConfig
WithMasters sets master address