metrics

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 5 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultMetricNamespace is the prefix of metric name.
	DefaultMetricNamespace = "dapr"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter interface {
	// Start initializes metrics exporter
	Start(context.Context) error
}

Exporter is the interface for metrics exporters.

func New added in v1.14.0

func New(opts Options) Exporter

New creates new metrics Exporter instance with given options.

type FlagOptions added in v1.14.0

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

func DefaultFlagOptions added in v1.14.0

func DefaultFlagOptions() *FlagOptions

func (*FlagOptions) AttachCmdFlags added in v1.14.0

func (f *FlagOptions) AttachCmdFlags(
	stringVar func(p *string, name string, value string, usage string),
	boolVar func(p *bool, name string, value bool, usage string),
)

AttachCmdFlag attaches single metrics option to command flags.

func (*FlagOptions) Enabled added in v1.14.0

func (f *FlagOptions) Enabled() bool

func (*FlagOptions) ListenAddress added in v1.15.0

func (f *FlagOptions) ListenAddress() string

func (*FlagOptions) Port added in v1.14.0

func (f *FlagOptions) Port() string

func (*FlagOptions) ToOptions added in v1.14.0

func (f *FlagOptions) ToOptions(healthz healthz.Healthz) Options

type Meter added in v1.18.5

type Meter struct {
	view.Meter
	// contains filtered or unexported fields
}

func NewMeter added in v1.18.5

func NewMeter() *Meter

func (*Meter) Record added in v1.18.5

func (m *Meter) Record(tags *tag.Map, measurement any, attachments map[string]any)

func (*Meter) Start added in v1.18.5

func (m *Meter) Start()

func (*Meter) Stop added in v1.18.5

func (m *Meter) Stop()

type Options

type Options struct {
	// Log is the metrics logger.
	Log logger.Logger
	// Enabled indicates whether a metrics server should be started.
	Enabled bool
	// Namespace is the prometheus exporter namespace.
	Namespace string
	// Port to start metrics server on.
	Port string
	// ListenAddress is the address that the metrics server listens on.
	ListenAddress string
	// Healthz is used to signal the health of the metrics server.
	Healthz healthz.Healthz
	// Meter is the OpenCensus meter used to register views.
	Meter view.Meter
}

Options defines the sets of options for exporting metrics.

func (*Options) MetricsListenAddress added in v1.14.0

func (o *Options) MetricsListenAddress() string

MetricsListenAddress gets metrics listen address.

Jump to

Keyboard shortcuts

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