prometheus

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 18 Imported by: 0

Documentation

Index

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 的配置

func (*Config) SetDefault

func (c *Config) SetDefault()

SetDefault Setting defaults

func (*Config) Verify

func (c *Config) Verify() error

Verify verify config

type PrometheusReporter

type PrometheusReporter struct {
	*plugin.PluginBase
	*common.RunContext
	// contains filtered or unexported fields
}

PrometheusReporter is a prometheus reporter.

func (*PrometheusReporter) Destroy

func (s *PrometheusReporter) Destroy() error

Destroy .销毁插件.

func (*PrometheusReporter) Info

func (s *PrometheusReporter) Info() model.StatInfo

Info 插件信息.

func (*PrometheusReporter) Init

Init 初始化插件.

func (*PrometheusReporter) Name

func (s *PrometheusReporter) Name() string

Name 插件名,一个类型下插件名唯一.

func (*PrometheusReporter) ReportStat

func (s *PrometheusReporter) ReportStat(metricsType model.MetricType, metricsVal model.InstanceGauge) error

ReportStat 报告统计数据.

func (*PrometheusReporter) Type

func (s *PrometheusReporter) Type() common.Type

Type 插件类型.

type PullAction

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

func (*PullAction) Info

func (pa *PullAction) Info() model.StatInfo

Info 插件信息.

func (*PullAction) Init

func (pa *PullAction) Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)

func (*PullAction) Run

func (pa *PullAction) Run(ctx context.Context)

type PushAction

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

func (*PushAction) Info

func (pa *PushAction) Info() model.StatInfo

Info 插件信息.

func (*PushAction) Init

func (pa *PushAction) Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)

func (*PushAction) Run

func (pa *PushAction) Run(ctx context.Context)

type ReportAction

type ReportAction interface {
	Init(initCtx *plugin.InitContext, reporter *PrometheusReporter)
	Run(ctx context.Context)
	Info() model.StatInfo
}

Jump to

Keyboard shortcuts

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