Documentation
¶
Index ¶
- Constants
- type Config
- type PrometheusReporter
- func (s *PrometheusReporter) Destroy() error
- func (s *PrometheusReporter) Info() model.StatInfo
- func (s *PrometheusReporter) Init(ctx *plugin.InitContext) error
- func (s *PrometheusReporter) Name() string
- func (s *PrometheusReporter) ReportStat(metricsType model.MetricType, metricsVal model.InstanceGauge) error
- func (s *PrometheusReporter) Type() common.Type
- type PullAction
- type PushAction
- type ReportAction
Constants ¶
View Source
const (
// PluginName is the name of the plugin.
PluginName = "prometheus"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Type string `yaml:"type"` IP string `yaml:"metricHost"` PortStr string `yaml:"metricPort"` Interval time.Duration `yaml:"interval"` Address string `yaml:"address"` // contains filtered or unexported fields }
Config prometheus 的配置
type PrometheusReporter ¶
type PrometheusReporter struct { *plugin.PluginBase *common.RunContext // contains filtered or unexported fields }
PrometheusReporter is a prometheus reporter.
func (*PrometheusReporter) Init ¶
func (s *PrometheusReporter) Init(ctx *plugin.InitContext) error
Init 初始化插件.
func (*PrometheusReporter) ReportStat ¶
func (s *PrometheusReporter) ReportStat(metricsType model.MetricType, metricsVal model.InstanceGauge) error
ReportStat 报告统计数据.
type PullAction ¶ added in v1.5.2
type PullAction struct {
// contains filtered or unexported fields
}
func (*PullAction) Close ¶ added in v1.6.0
func (pa *PullAction) Close()
func (*PullAction) Init ¶ added in v1.5.2
func (pa *PullAction) Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)
func (*PullAction) Run ¶ added in v1.5.2
func (pa *PullAction) Run(ctx context.Context)
type PushAction ¶ added in v1.5.2
type PushAction struct {
// contains filtered or unexported fields
}
func (*PushAction) Close ¶ added in v1.6.0
func (pa *PushAction) Close()
func (*PushAction) Init ¶ added in v1.5.2
func (pa *PushAction) Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)
func (*PushAction) Run ¶ added in v1.5.2
func (pa *PushAction) Run(ctx context.Context)
type ReportAction ¶ added in v1.5.2
type ReportAction interface { Init(initCtx *plugin.InitContext, reporter *PrometheusReporter) Run(ctx context.Context) Info() model.StatInfo Close() }
Click to show internal directories.
Click to hide internal directories.