metrics

package
v0.0.0-...-a0c90f5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCExport

func NewGRPCExport(ctx context.Context, conf MetricConfig) (metric.Exporter, error)

NewGRPCExport 创建一个使用 GRPC 协议连接的Exporter

func NewHTTPExport

func NewHTTPExport(ctx context.Context, conf MetricConfig) (metric.Exporter, error)

NewHTTPExport 创建一个使用 HTTP 协议连接的Exporter

Types

type ExportMetric

type ExportMetric func(context.Context, MetricConfig) (metric.Exporter, error)

func LoadExport

func LoadExport(driver string) ExportMetric

type MetricBatch

type MetricBatch struct {
	Timeout  int32 `json:"timeout,omitempty"`  // 测试环境填1方便调试
	Interval int32 `json:"interval,omitempty"` // 测试环境填1方便调试
}

type MetricConfig

type MetricConfig struct {
	Driver      string                 `json:"driver" description:"Metric驱动"` // e.g prometheus/victoriametrics/greptime
	Disabled    bool                   `json:"disabled,omitempty" description:"是否禁用"`
	Endpoint    string                 `json:"endpoint" description:"Metric接口地址uri"`
	Batch       MetricBatch            `json:"batch" description:"批量上传配置"`
	Auth        map[string]string      `json:"auth,omitempty" description:"认证"`
	Options     map[string]any         `json:"options,omitempty" description:"驱动独立参数"`
	Credentials *tls.ClientCredentials `json:"credentials,omitempty" description:"ssl链接配置"`
}

Jump to

Keyboard shortcuts

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