package stats

import "google.golang.org/grpc/internal/stats"

Package stats provides internal stats related functionality.

Index

Functions

func SetLabels

func SetLabels(ctx context.Context, labels *Labels) context.Context

SetLabels sets the Labels in the context.

Types

type Labels

type Labels struct {
	// TelemetryLabels are the telemetry labels to record.
	TelemetryLabels map[string]string
}

Labels are the labels for metrics.

func GetLabels

func GetLabels(ctx context.Context) *Labels

GetLabels returns the Labels stored in the context, or nil if there is one.

type MetricsRecorderList

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

MetricsRecorderList forwards Record calls to all of its metricsRecorders.

It eats any record calls where the label values provided do not match the number of label keys.

func NewMetricsRecorderList

func NewMetricsRecorderList(shs []stats.Handler) *MetricsRecorderList

NewMetricsRecorderList creates a new metric recorder list with all the stats handlers provided which implement the MetricsRecorder interface. If no stats handlers provided implement the MetricsRecorder interface, the MetricsRecorder list returned is a no-op.

func (*MetricsRecorderList) RecordFloat64Count

func (l *MetricsRecorderList) RecordFloat64Count(handle *estats.Float64CountHandle, incr float64, labels ...string)

func (*MetricsRecorderList) RecordFloat64Histo

func (l *MetricsRecorderList) RecordFloat64Histo(handle *estats.Float64HistoHandle, incr float64, labels ...string)

func (*MetricsRecorderList) RecordInt64Count

func (l *MetricsRecorderList) RecordInt64Count(handle *estats.Int64CountHandle, incr int64, labels ...string)

func (*MetricsRecorderList) RecordInt64Gauge

func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, incr int64, labels ...string)

func (*MetricsRecorderList) RecordInt64Histo

func (l *MetricsRecorderList) RecordInt64Histo(handle *estats.Int64HistoHandle, incr int64, labels ...string)

Source Files

labels.go metrics_recorder_list.go

Version
v1.66.3
Published
Sep 30, 2024
Platform
linux/amd64
Imports
4 packages
Last checked
17 seconds ago

Tools for package owners.