Documentation
¶
Index ¶
- type Prometheus
- func (p *Prometheus) Clone() internal.Configurable
- func (p *Prometheus) Disable() *Prometheus
- func (p *Prometheus) Enable() *Prometheus
- func (p *Prometheus) EnablePushGateway() *Prometheus
- func (p *Prometheus) Get() interface{}
- func (p *Prometheus) IsEnabled() bool
- func (p *Prometheus) Set(data interface{})
- func (p *Prometheus) Validate() error
- func (p *Prometheus) WithEnabled(enabled bool) *Prometheus
- func (p *Prometheus) WithEndpoint(endpoint string) *Prometheus
- func (p *Prometheus) WithModuleName(moduleName string) *Prometheus
- func (p *Prometheus) WithPath(path string) *Prometheus
- func (p *Prometheus) WithPort(port int) *Prometheus
- func (p *Prometheus) WithPushGateway(enabled bool, endpoint, jobName string) *Prometheus
- func (p *Prometheus) WithScraping(interval, timeout, metricsPath string) *Prometheus
- type PushGateway
- type Scraping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prometheus ¶
type Prometheus struct {
ModuleName string `mapstructure:"module-name" yaml:"module-name" json:"moduleName"` // 模块名称
Enabled bool `mapstructure:"enabled" yaml:"enabled" json:"enabled"` // 是否启用Prometheus
Path string `mapstructure:"path" yaml:"path" json:"path"` // Prometheus路径
Port int `mapstructure:"port" yaml:"port" json:"port"` // Prometheus端口
Endpoint string `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint"` // Prometheus端点
PushGateway *PushGateway `mapstructure:"push-gateway" yaml:"push-gateway" json:"pushGateway"` // PushGateway配置
Scraping *Scraping `mapstructure:"scraping" yaml:"scraping" json:"scraping"` // 抓取配置
}
Prometheus Prometheus配置
func (*Prometheus) EnablePushGateway ¶
func (p *Prometheus) EnablePushGateway() *Prometheus
EnablePushGateway 启用PushGateway
func (*Prometheus) WithEnabled ¶
func (p *Prometheus) WithEnabled(enabled bool) *Prometheus
WithEnabled 设置是否启用
func (*Prometheus) WithEndpoint ¶
func (p *Prometheus) WithEndpoint(endpoint string) *Prometheus
WithEndpoint 设置端点
func (*Prometheus) WithModuleName ¶
func (p *Prometheus) WithModuleName(moduleName string) *Prometheus
WithModuleName 设置模块名称
func (*Prometheus) WithPushGateway ¶
func (p *Prometheus) WithPushGateway(enabled bool, endpoint, jobName string) *Prometheus
WithPushGateway 设置PushGateway配置
func (*Prometheus) WithScraping ¶
func (p *Prometheus) WithScraping(interval, timeout, metricsPath string) *Prometheus
WithScraping 设置抓取配置
type PushGateway ¶
type PushGateway struct {
Enabled bool `mapstructure:"enabled" yaml:"enabled" json:"enabled"` // 是否启用PushGateway
Endpoint string `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint"` // PushGateway端点
JobName string `mapstructure:"job-name" yaml:"job-name" json:"jobName"` // Job名称
}
PushGateway PushGateway配置
type Scraping ¶
type Scraping struct {
Interval string `mapstructure:"interval" yaml:"interval" json:"interval"` // 抓取间隔
Timeout string `mapstructure:"timeout" yaml:"timeout" json:"timeout"` // 超时时间
MetricsPath string `mapstructure:"metrics-path" yaml:"metrics-path" json:"metricsPath"` // 指标路径
}
Scraping 抓取配置
Click to show internal directories.
Click to hide internal directories.