metrics

package
v2.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIRequestTotal = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "api_request_count",
		Help:      "The total count of API calls.",
	},
	[]string{"code", "path", "verb"},
)

APIRequestTotal returns the total count of API calls

View Source
var AssetsBytesTotal = prometheus.NewGauge(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "assets_bytes_total",
		Help:      "The total bytes of assets.",
	},
)

AssetsBytesTotal returns the total bytes of assets

View Source
var AssetsItemsTotal = prometheus.NewGauge(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "assets_items_total",
		Help:      "The total items of assets.",
	},
)

AssetsItemsTotal returns the total Items of assets

View Source
var ImagesBytesTotal = prometheus.NewGauge(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "images_bytes_total",
		Help:      "The total bytes of Images.",
	},
)

ImagesBytesTotal returns the total bytes of Images

View Source
var ImagesItemsTotal = prometheus.NewGauge(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "images_items_total",
		Help:      "The total items of Images.",
	},
)

ImagesItemsTotal returns the total Items of Images

View Source
var MachineStatus = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "machine_status",
		Help:      "The machine status set by HTTP API.",
	},
	[]string{"status", "address", "serial", "rack", "role", "machine_type"},
)

MachineStatus returns the machine state metrics

Functions

func GetHandler

func GetHandler(collector *Collector) http.Handler

GetHandler return http.Handler for prometheus metrics

Types

type APICounter

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

APICounter represents API counter.

func NewCounter

func NewCounter() *APICounter

NewCounter returns a new APICounter.

func (*APICounter) Inc

func (c *APICounter) Inc(statusCode int, path, verb string)

Inc increments the counter.

type Collector added in v2.5.1

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

Collector is a metrics collector for Sabakan.

func NewCollector added in v2.5.1

func NewCollector(model *sabakan.Model) *Collector

NewCollector returns a new Collector.

func (Collector) Collect added in v2.5.1

func (c Collector) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.Collect().

func (Collector) Describe added in v2.5.1

func (c Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.Describe().

type Metric added in v2.5.1

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

Metric represents collectors and updater of metric.

Jump to

Keyboard shortcuts

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