metrics

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestsHistogram = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "datasource",
			Name:      "snapshot_sdk_requests",
			Help:      "Time taken to process snapshot requests",
			Buckets:   []float64{.005, .01, .025, .05, .075, .1, .15, .2, .25, .5, 1, 2.5, 5, 10, 15, 30},
		},
		[]string{"client", "method", "error"},
	)

	SnapshotKeyStateGauge = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "datasource",
			Name:      "snapshot_key_state",
			Help:      "Stores the last received number of remaining requests",
		}, []string{"key", "name"},
	)
)

Functions

func CollectRequestsMetric

func CollectRequestsMetric(client, method string, err error, start time.Time)

func CollectSnapshotKeyState added in v0.4.2

func CollectSnapshotKeyState(key, name string, val float64)

Types

type HeaderWatcher added in v0.4.2

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

func NewHeaderWatcher added in v0.4.2

func NewHeaderWatcher(name string) *HeaderWatcher

func (*HeaderWatcher) RoundTrip added in v0.4.2

func (m *HeaderWatcher) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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