metrics

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PromRegistry *prometheus.Registry
)

Functions

func ObservePrimaryAdapterDuration

func ObservePrimaryAdapterDuration(duration time.Duration, labels domain.PrimaryAdapterDurationLabels)

func ObserveSecondaryAdapterCallDuration

func ObserveSecondaryAdapterCallDuration(duration time.Duration, labels domain.SecondaryAdapterCallDurationLabels)

func ObserveSecondaryAdapterTaskDuration

func ObserveSecondaryAdapterTaskDuration(duration time.Duration, labels domain.SecondaryAdapterTaskDurationLabels)

func ServeMetrics

func ServeMetrics(ctx context.Context, wg *sync.WaitGroup)

func SetGaugeMetricsFromSpecs

func SetGaugeMetricsFromSpecs(spec model.ResiliencySpec, telemetryCtx domain.TelemetryContext)

SetGaugeMetricsFromSpecs sets gauge metrics from resiliency spec. `With` can panic, however, it shouldn't if the labels match what's defined in Metrics instance.

func SetPrimaryAdapterInProgress added in v1.0.15

func SetPrimaryAdapterInProgress(op domain.GaugeOp, labels domain.PrimaryAdapterInProgressLabels)

Types

type Metrics

type Metrics struct {
	PrimaryAdapterDuration         *prometheus.HistogramVec
	SecondaryAdapterCallDuration   *prometheus.HistogramVec
	SecondaryAdapterTaskDuration   *prometheus.HistogramVec
	PrimaryAdapterInProgress       *prometheus.GaugeVec
	CallTimeout                    *prometheus.GaugeVec
	TaskTimeout                    *prometheus.GaugeVec
	CircuitBreakerDisabled         *prometheus.GaugeVec
	CircuitBreakerCountRetries     *prometheus.GaugeVec
	CircuitBreakerIntervalSecs     *prometheus.GaugeVec
	CircuitBreakerMaxRequests      *prometheus.GaugeVec
	CircuitBreakerMinRequests      *prometheus.GaugeVec
	CircuitBreakerTimeout          *prometheus.GaugeVec
	CircuitBreakerRatio            *prometheus.GaugeVec
	CircuitBreakerConsecutiveFails *prometheus.GaugeVec
	RetryDisabled                  *prometheus.GaugeVec
	RetryMaxAttempt                *prometheus.GaugeVec
	RetryInitialBackoff            *prometheus.GaugeVec
}

func GetInstance

func GetInstance() *Metrics

Jump to

Keyboard shortcuts

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