metrics

package
v1.34.10 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APINameLoadBalancer = "loadbalancer"
	APINameIaaS         = "iaas"
)

Variables

View Source
var (
	HTTPRequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace:   cloudProviderMetricPrefix,
		Name:        "http_requests_total",
		Help:        "The number of requests to external APIs",
		ConstLabels: nil,
	}, []string{apiLabel, methodLabel, operationLabel, codeLabel})

	HTTPErrorCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace:   cloudProviderMetricPrefix,
		Name:        "http_errors_total",
		Help:        "Number of HTTP errors returned by external APIs",
		ConstLabels: nil,
	}, []string{apiLabel, methodLabel, operationLabel, codeLabel})

	HTTPRequestDurationHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace:   cloudProviderMetricPrefix,
		Name:        "http_request_duration_seconds",
		Help:        "The response times of external API requests",
		ConstLabels: nil,
		Buckets:     nil,
	}, []string{apiLabel, methodLabel, operationLabel, codeLabel})
)

Functions

func NewInstrumentedHTTPClient

func NewInstrumentedHTTPClient(api string) *http.Client

func Run

func Run(ctx context.Context, metricsAddr string) error

Types

type Exporter

type Exporter struct {
}

func NewExporter

func NewExporter() *Exporter

func (*Exporter) Collect

func (e *Exporter) Collect(metrics chan<- prometheus.Metric)

func (*Exporter) Describe

func (e *Exporter) Describe(descs chan<- *prometheus.Desc)

type InstrumentedRoundTripper

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

func (*InstrumentedRoundTripper) RoundTrip

func (rt *InstrumentedRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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