Documentation ¶
Index ¶
- Constants
- func CosmosChargeMetric() *prometheus.GaugeVec
- func CosmosDurationMetric() *prometheus.GaugeVec
- func NewDurationMetric(name string, buckets []float64) *prometheus.HistogramVec
- func RequestsCounterMetric() *prometheus.CounterVec
- func RequestsLatencyMetric() *prometheus.HistogramVec
- type LatencyObservers
- type Logger
- type LoggingResponseWriter
- type Metrics
- type MetricsOption
- type Prometheus
Constants ¶
const (
TenanciesIdentityPrefix = "tenant/"
)
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 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 (*Metrics) NewLatencyMetricsHandler ¶
func (*Metrics) NewPromHandler ¶
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) Register ¶
func (m *Metrics) Register(cs ...prometheus.Collector)
type MetricsOption ¶
type MetricsOption func(*Metrics)
func WithLabel ¶
func WithLabel(label string, offset int) MetricsOption
type Prometheus ¶
type Prometheus interface { }