metrics

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package metrics contains the prometheus infrastructure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisMetrics added in v0.2.4

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

Default service metrics for analyzer operations.

func NewDefaultAnalysisMetrics added in v0.2.4

func NewDefaultAnalysisMetrics(runtime string) AnalysisMetrics

NewDefaultAnalysisMetrics creates Prometheus metric instrumentation for basic metrics common to storage accesses.

func (*AnalysisMetrics) BlockAnalysisLatencies added in v0.2.4

func (m *AnalysisMetrics) BlockAnalysisLatencies() *prometheus.Timer

func (*AnalysisMetrics) BlockFetchLatencies added in v0.2.4

func (m *AnalysisMetrics) BlockFetchLatencies() *prometheus.Timer

func (*AnalysisMetrics) DatabaseLatencies added in v0.2.4

func (m *AnalysisMetrics) DatabaseLatencies(db string, operation string) *prometheus.Timer

DatabaseLatencies returns a new latency timer for the provided database operation. The provided params are used as labels.

func (*AnalysisMetrics) DatabaseOperations added in v0.2.4

func (m *AnalysisMetrics) DatabaseOperations(db, operation, status string) prometheus.Counter

DatabaseOperations returns the counter for the database operation. The provided params are used as labels.

func (*AnalysisMetrics) LocalCacheReads added in v0.2.4

func (m *AnalysisMetrics) LocalCacheReads(status CacheReadStatus) prometheus.Counter

LocalCacheReads returns the counter for the local cache read. The provided params are used as labels.

func (*AnalysisMetrics) QueueLength added in v0.2.6

func (m *AnalysisMetrics) QueueLength(analyzer string) prometheus.Gauge

type CacheReadStatus added in v0.1.16

type CacheReadStatus string
const (
	CacheReadStatusHit      CacheReadStatus = "hit"
	CacheReadStatusMiss     CacheReadStatus = "miss"
	CacheReadStatusBadValue CacheReadStatus = "bad_value" // Value in cache was not valid (likely because of mismatched types / CBOR encoding).
	CacheReadStatusError    CacheReadStatus = "error"     // Other internal error reading from cache.
)

type PullService

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

PullService is a service that supports the Prometheus pull method.

func NewPullService

func NewPullService(pullEndpoint string, rootLogger *log.Logger) (*PullService, error)

Creates a new Prometheus pull service.

func (*PullService) StartInstrumentation

func (s *PullService) StartInstrumentation()

StartInstrumentation starts the pull metrics service.

type RequestMetrics

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

Default service metrics for requests.

func NewDefaultRequestMetrics

func NewDefaultRequestMetrics(pkg string) RequestMetrics

NewDefaultRequestMetrics creates Prometheus metric instrumentation for basic metrics common to serving requests. Default metrics include:

1. Counts of service endpoints hit. 2. Latencies for requests.

func (*RequestMetrics) RequestCounts

func (m *RequestMetrics) RequestCounts(endpoint, status string) prometheus.Counter

RequestCounts returns the counter for the calling request. Provided labels should be endpoint, status, and cause.

func (*RequestMetrics) RequestLatencies

func (m *RequestMetrics) RequestLatencies(endpoint string) prometheus.Observer

RequestLatencies fetches the Histogram Observer for the given endpoint If it doesn't exist, a new one is created. This creates 12 (with DefBuckets) empty tables in the prometheus database.

Jump to

Keyboard shortcuts

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