metrics

package
v0.0.0-...-949823d Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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

func New(opts Options) Exporter

New creates new metrics Exporter instance with given options.

type FlagOptions

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

func DefaultFlagOptions

func DefaultFlagOptions() *FlagOptions

func (*FlagOptions) AttachCmdFlags

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

func (f *FlagOptions) Enabled() bool

func (*FlagOptions) Port

func (f *FlagOptions) Port() string

func (*FlagOptions) ToOptions

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

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