xprometheus

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CategoryCount = "count"
	CategoryGauge = "gauge"
)

Functions

func RemoteWrite

func RemoteWrite(data []Hdata, opt RemoteWriteOpt) (err error)

RemoteWrite @Description: 远程写如prometheus @param data @param opt @return err

Types

type HMetric

type HMetric struct {
	Bucket      []Hdata
	SampleSum   Hdata
	SampleCount Hdata
}

func GetHistogramMetrics

func GetHistogramMetrics(name string, job string, t time.Time, histogram prometheus.Histogram) (metics HMetric)

GetHistogramMetrics @Description: 获取Histogram remote write 数据 @param name metric name @param job job name @param t time @param histogram 数据 @return metics

type Hdata

type Hdata struct {
	Name   string
	Label  []promwrite.Label
	Sample promwrite.Sample
}

func GetCountMetrics

func GetCountMetrics(name string, job string, t time.Time, counter prometheus.Counter) (metics Hdata)

GetCountMetrics @Description: 获取Count remote write 数据 @param name metric name @param job job name @param t time @param histogram 数据 @return metics

func GetGaugeMetrics

func GetGaugeMetrics(name string, job string, t time.Time, counter prometheus.Gauge) (metics Hdata)

GetGaugeMetrics @Description: 获取Count remote write 数据 @param name metric name @param job job name @param t time @param histogram 数据 @return metics

type RemoteWriteOpt

type RemoteWriteOpt struct {
	Username string
	Password string
	URL      string
}

Jump to

Keyboard shortcuts

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