metrics

package
v0.0.0-...-3c1e1a6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HealthKey name of the health metric.
	HealthKey = "eventing_epp_health"

	// BackendLatencyKey name of the backendLatency metric.
	BackendLatencyKey = "eventing_epp_backend_duration_milliseconds"

	// RequestsKey name of the Requests metric.
	RequestsKey = "eventing_epp_requests_total"

	// EventTypePublishedMetricKey name of the eventTypeLabel metric.
	EventTypePublishedMetricKey = "eventing_epp_event_type_published_total"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

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

Collector implements the prometheus.Collector interface.

func NewCollector

func NewCollector(latency histogram.BucketsProvider) *Collector

NewCollector creates a new instance of Collector.

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface Collect method.

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface Describe method.

func (*Collector) MetricsMiddleware

func (c *Collector) MetricsMiddleware() mux.MiddlewareFunc

MetricsMiddleware returns a http.Handler that can be used as middleware in gorilla.mux to track latencies for all handled paths in the gorilla router.

func (*Collector) RecordBackendLatency

func (c *Collector) RecordBackendLatency(duration time.Duration, statusCode int, destSvc string)

RecordLatency records a backendLatencyHelp metric.

func (*Collector) RecordEventType

func (c *Collector) RecordEventType(eventType, eventSource string, statusCode int)

RecordEventType records an eventType metric.

func (*Collector) SetHealthStatus

func (c *Collector) SetHealthStatus(healthy bool)

SetHealthStatus updates the health metric.

type PublishingMetricsCollector

type PublishingMetricsCollector interface {
	prometheus.Collector
	RecordBackendLatency(duration time.Duration, statusCode int, destSvc string)
	RecordEventType(eventType, eventSource string, statusCode int)
	MetricsMiddleware() mux.MiddlewareFunc
}

PublishingMetricsCollector interface provides a Prometheus compatible Collector with additional convenience methods for recording epp specific metrics.

type Server

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

func NewServer

func NewServer(logger *logger.Logger) *Server

func (*Server) Start

func (s *Server) Start(address string) error

func (*Server) Stop

func (s *Server) Stop()

Directories

Path Synopsis
Package metricstest provides utilities for metrics testing.
Package metricstest provides utilities for metrics testing.

Jump to

Keyboard shortcuts

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