infosync

package
v1.3.3-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoProm = errors.New("no prometheus info")
)

Functions

This section is empty.

Types

type InfoSyncer

type InfoSyncer struct {
	// contains filtered or unexported fields
}

InfoSyncer syncs TiProxy topology to ETCD and queries TiDB topology from ETCD. It writes 2 items to ETCD: `/topology/tiproxy/.../info` and `/topology/tiproxy/.../ttl`. They are erased after TiProxy is down. The code is modified from github.com/pingcap/tidb/domain/infosync/info.go.

func NewInfoSyncer

func NewInfoSyncer(lg *zap.Logger, etcdCli *clientv3.Client) *InfoSyncer

func (*InfoSyncer) Close

func (is *InfoSyncer) Close() error

func (*InfoSyncer) GetPromInfo added in v1.1.0

func (is *InfoSyncer) GetPromInfo(ctx context.Context) (*PrometheusInfo, error)

func (*InfoSyncer) GetTiDBTopology

func (is *InfoSyncer) GetTiDBTopology(ctx context.Context) (map[string]*TiDBTopologyInfo, error)

func (*InfoSyncer) Init

func (is *InfoSyncer) Init(ctx context.Context, cfg *config.Config) error

type PrometheusInfo added in v1.1.0

type PrometheusInfo struct {
	IP         string `json:"ip"`
	BinaryPath string `json:"binary_path"`
	Port       int    `json:"port"`
}

PrometheusInfo is the info of prometheus.

type TiDBTopologyInfo added in v1.1.0

type TiDBTopologyInfo struct {
	Version        string            `json:"version"`
	GitHash        string            `json:"git_hash"`
	IP             string            `json:"ip"`
	StatusPort     uint              `json:"status_port"`
	DeployPath     string            `json:"deploy_path"`
	StartTimestamp int64             `json:"start_timestamp"`
	Labels         map[string]string `json:"labels"`
}

TiDBTopologyInfo is the topology info of TiDB.

type TopologyInfo

type TopologyInfo struct {
	Version        string `json:"version"`
	GitHash        string `json:"git_hash"`
	IP             string `json:"ip"`
	Port           string `json:"port"`
	StatusPort     string `json:"status_port"`
	DeployPath     string `json:"deploy_path"`
	StartTimestamp int64  `json:"start_timestamp"`
}

TopologyInfo is the info of TiProxy.

Jump to

Keyboard shortcuts

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