metrics

package
v1.14.2-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

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) 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 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
}

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