metrics

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TranslateMetricsToPrometheusTextFormat

func TranslateMetricsToPrometheusTextFormat(w *bytes.Buffer, ms []*metrics.MetricSnapshot, lisAddr, path string)

TranslateMetricsToPrometheusTextFormat translates Service Weaver metrics (keyed by weavelet id) to a text format that can be scraped by Prometheus [1].

[1] https://prometheus.io/

Types

type AppStatuszInfo

type AppStatuszInfo struct {
	App        string
	Deployment string
	Age        string
	TraceFile  string
	Listeners  map[string][]string
	Config     map[string]string
	Components []ComponentStatuszInfo
}

AppStatuszInfo contains per app information to be displayed on the /statusz page.

type ComponentStatuszInfo

type ComponentStatuszInfo struct {
	Name        string              // Name of the component
	Replication int                 // Number of replicas
	Stats       []methodStatuszInfo // Per method status
}

ComponentStatuszInfo contains per component information to be displayed on the /statusz page.

type StatsProcessor

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

StatsProcessor keeps track of various statistics for a given app deployment.

func NewStatsProcessor

func NewStatsProcessor() *StatsProcessor

func (*StatsProcessor) CollectMetrics

func (s *StatsProcessor) CollectMetrics(ctx context.Context, snapshotFn func() []*metrics.MetricSnapshot) error

CollectMetrics enables the stats processor to update the tracked stats based on a new set of metrics provided by snapshotFn.

func (*StatsProcessor) GetStatsStatusz

func (s *StatsProcessor) GetStatsStatusz() map[string][]methodStatuszInfo

GetStatsStatusz returns the latest stats that should be rendered on the /statusz page.

Jump to

Keyboard shortcuts

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