metrics

package
v0.0.0-...-2119b44 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MPL-2.0 Imports: 7 Imported by: 37

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectAndPushSimMetrics

func CollectAndPushSimMetrics(pushGatewayHost string, configMetrics []MetricConfig, selectedMetric string, Value float64, Labels map[string]string, systemName string) error

func PushMetrics

func PushMetrics(pusMetricHost string, metrics []MetricConfig, metriJobName string)

func StartMetricsServer

func StartMetricsServer(conf *config.Metrics)

Types

type MetricConfig

type MetricConfig struct {
	Name    string
	Type    string
	Labels  map[string]string
	Details string
	Buckets []float64
	Value   float64
}

type MetricType

type MetricType string
const (
	MetricUnkown    MetricType = "unavailable"
	MetricGuage     MetricType = "guage"
	MetricCounter   MetricType = "counter"
	MetricHistogram MetricType = "histogram"
	MetricSummary   MetricType = "summary"
)

func MetricTypeFromString

func MetricTypeFromString(s string) MetricType

type Metrics

type Metrics struct {
	Name string
	Type MetricType

	Labels prometheus.Labels
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(name string, mtype string) *Metrics

func (*Metrics) InitializeMetric

func (m *Metrics) InitializeMetric(name string, config MetricConfig, customLables []string) error

func (*Metrics) SetMetric

func (m *Metrics) SetMetric(value float64, labels prometheus.Labels) error

Jump to

Keyboard shortcuts

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