metrics

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TenanciesIdentityPrefix = "tenant/"
)
View Source
const (
	URLPrefix = "archivist"
)

Tailored Prometheus metrics

Variables

This section is empty.

Functions

func CosmosChargeMetric

func CosmosChargeMetric() *prometheus.GaugeVec

CosmosChargeMetric measures cosmos request charge per tenant using inbuilt Set method

func CosmosDurationMetric

func CosmosDurationMetric() *prometheus.GaugeVec

CosmosDurationMetric measures cosmos request duration(ms) per tenant using inbuilt Set method

func NewDurationMetric added in v0.13.8

func NewDurationMetric(name string, buckets []float64) *prometheus.HistogramVec

create metric according to duration. DurationMetric measures an SLA "95% of all confirmations must be made in less than 5minutes" and to plot average confirmation time and the apdex score. https://www.bookstack.cn/read/prometheus-en/1e87bb1c6ea1f003.md bucket limits are in seconds... and may be different for simple hash, merkle log or other duration metrics.

func RequestsCounterMetric

func RequestsCounterMetric() *prometheus.CounterVec

RequestsCounterMetric measures consumption per tenant

func RequestsLatencyMetric

func RequestsLatencyMetric() *prometheus.HistogramVec

RequestsLatencyMetric measures an SLA "95% of all requests must be made in less than 100ms" and to plot average response latency and the apdex score. https://www.bookstack.cn/read/prometheus-en/1e87bb1c6ea1f003.md bucket limits are in seconds...

Types

type LatencyObservers

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

Latency observers

func NewLatencyObservers

func NewLatencyObservers(m *Metrics) LatencyObservers

NewLatencyObservers is specific to calculating the network latency and packet count.

func (*LatencyObservers) ObserveRequestsCount

func (o *LatencyObservers) ObserveRequestsCount(fields []string, method string, tenant string)

func (*LatencyObservers) ObserveRequestsLatency

func (o *LatencyObservers) ObserveRequestsLatency(elapsed float64, fields []string, method string, tenant string)

type Logger

type Logger = logger.Logger

type LoggingResponseWriter

type LoggingResponseWriter struct {
	http.ResponseWriter
	StatusCode int
}

we have to intercept the ResponseWriter in order to get the statuscode

type Metrics

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

Metrics. Only those metrics specified are returned. The GoCollector and ProcessCollector metrics are omitted by using our own registry.

func New

func New(log Logger, serviceName string, port string, opts ...MetricsOption) *Metrics

func (*Metrics) NewLatencyMetricsHandler

func (m *Metrics) NewLatencyMetricsHandler(h http.Handler) http.Handler

func (*Metrics) NewPromHandler

func (m *Metrics) NewPromHandler() http.Handler

NewPromHandler - this handler is used on the endpoint that serves metrics endpoint which is provided on a different port to the service. The default InstrumentMetricHandler is suppressed.

func (*Metrics) Port

func (m *Metrics) Port() string

func (*Metrics) Register

func (m *Metrics) Register(cs ...prometheus.Collector)

func (*Metrics) String added in v0.11.0

func (m *Metrics) String() string

type MetricsOption

type MetricsOption func(*Metrics)

func WithLabel

func WithLabel(label string, offset int) MetricsOption

type Prometheus

type Prometheus interface {
}

Jump to

Keyboard shortcuts

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