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 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.Timer
RequestLatencies creates a new latency timer for the provided request endpoint.
type StorageMetrics ¶ added in v0.1.16
type StorageMetrics struct {
// contains filtered or unexported fields
}
Default service metrics for database operations.
func NewDefaultStorageMetrics ¶ added in v0.1.16
func NewDefaultStorageMetrics(runtime string) StorageMetrics
NewDefaultStorageMetrics creates Prometheus metric instrumentation for basic metrics common to storage accesses.
func (*StorageMetrics) DatabaseLatencies ¶ added in v0.1.16
func (m *StorageMetrics) 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 (*StorageMetrics) DatabaseOperations ¶ added in v0.1.16
func (m *StorageMetrics) DatabaseOperations(db, operation, status string) prometheus.Counter
DatabaseOperations returns the counter for the database operation. The provided params are used as labels.
func (*StorageMetrics) LocalCacheReads ¶ added in v0.1.16
func (m *StorageMetrics) LocalCacheReads(status CacheReadStatus) prometheus.Counter
LocalCacheReads returns the counter for the local cache read. The provided params are used as labels.