metrics

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTypeFromResourceID

func GetTypeFromResourceID(resourceID string) string

GetTypeFromResourceID is a helper method for metrics to extract resourceType from resourceID

func RegisterMetrics

func RegisterMetrics(metrics ...Metrics)

Types

type ARMClientMetrics

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

func NewARMClientMetrics

func NewARMClientMetrics() ARMClientMetrics

func (ARMClientMetrics) RecordAzureFailedRequestsTotal

func (a ARMClientMetrics) RecordAzureFailedRequestsTotal(resourceName string, method HTTPMethod)

RecordAzureFailedRequestsTotal records the number of failed requests to ARM.

func (ARMClientMetrics) RecordAzureRequestsTime

func (a ARMClientMetrics) RecordAzureRequestsTime(resourceName string, requestTime time.Duration, method HTTPMethod)

RecordAzureRequestsTime records the round-trip time taken by the request to ARM.

func (ARMClientMetrics) RecordAzureSuccessRequestsTotal

func (a ARMClientMetrics) RecordAzureSuccessRequestsTotal(resourceName string, statusCode int, method HTTPMethod)

RecordAzureSuccessRequestsTotal records the total successful number requests to ARM by increasing the counter.

func (ARMClientMetrics) RegisterMetrics

func (a ARMClientMetrics) RegisterMetrics()

RegisterMetrics registers the collectors with prometheus server.

type HTTPMethod

type HTTPMethod string
const (
	HttpPut    HTTPMethod = http.MethodPut
	HttpDelete HTTPMethod = http.MethodDelete
	HttpGet    HTTPMethod = http.MethodGet
)

type Metrics

type Metrics interface {
	RegisterMetrics()
}

Jump to

Keyboard shortcuts

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