usagemetrics

package
v1.14.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gauges = []prometheus.GaugeDefinition{
	{
		Name: []string{"consul", "state", "nodes"},
		Help: "Deprecated - please use state_nodes instead.",
	},
	{
		Name: []string{"state", "nodes"},
		Help: "Measures the current number of nodes registered with Consul. It is only emitted by Consul servers. Added in v1.9.0.",
	},
	{
		Name: []string{"consul", "state", "peerings"},
		Help: "Deprecated - please use state_peerings instead.",
	},
	{
		Name: []string{"state", "peerings"},
		Help: "Measures the current number of peerings registered with Consul. It is only emitted by Consul servers. Added in v1.13.0.",
	},
	{
		Name: []string{"consul", "state", "services"},
		Help: "Deprecated - please use state_services instead.",
	},
	{
		Name: []string{"state", "services"},
		Help: "Measures the current number of unique services registered with Consul, based on service name. It is only emitted by Consul servers. Added in v1.9.0.",
	},
	{
		Name: []string{"consul", "state", "service_instances"},
		Help: "Deprecated - please use state_service_instances instead.",
	},
	{
		Name: []string{"state", "service_instances"},
		Help: "Measures the current number of unique services registered with Consul, based on service name. It is only emitted by Consul servers. Added in v1.9.0.",
	},
	{
		Name: []string{"consul", "members", "clients"},
		Help: "Deprecated - please use members_clients instead.",
	},
	{
		Name: []string{"members", "clients"},
		Help: "Measures the current number of client agents registered with Consul. It is only emitted by Consul servers. Added in v1.9.6.",
	},
	{
		Name: []string{"consul", "members", "servers"},
		Help: "Deprecated - please use members_servers instead.",
	},
	{
		Name: []string{"members", "servers"},
		Help: "Measures the current number of server agents registered with Consul. It is only emitted by Consul servers. Added in v1.9.6.",
	},
	{
		Name: []string{"consul", "state", "kv_entries"},
		Help: "Deprecated - please use kv_entries instead.",
	},
	{
		Name: []string{"state", "kv_entries"},
		Help: "Measures the current number of entries in the Consul KV store. It is only emitted by Consul servers. Added in v1.10.3.",
	},
	{
		Name: []string{"consul", "state", "connect_instances"},
		Help: "Deprecated - please use state_connect_instances instead.",
	},
	{
		Name: []string{"state", "connect_instances"},
		Help: "Measures the current number of unique connect service instances registered with Consul, labeled by Kind. It is only emitted by Consul servers. Added in v1.10.4.",
	},
	{
		Name: []string{"consul", "state", "config_entries"},
		Help: "Deprecated - please use state_config_entries instead.",
	},
	{
		Name: []string{"state", "config_entries"},
		Help: "Measures the current number of unique configuration entries registered with Consul, labeled by Kind. It is only emitted by Consul servers. Added in v1.10.4.",
	},
}

Functions

This section is empty.

Types

type Config

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

Config holds the settings for various parameters for the UsageMetricsReporter

func (*Config) WithDatacenter

func (c *Config) WithDatacenter(dc string) *Config

WithDatacenter adds the datacenter as a label to all metrics emitted by the UsageMetricsReporter

func (*Config) WithGetMembersFunc added in v1.9.6

func (c *Config) WithGetMembersFunc(fn getMembersFunc) *Config

WithGetMembersFunc specifies the function used to identify cluster members

func (*Config) WithLogger

func (c *Config) WithLogger(logger hclog.Logger) *Config

WithLogger takes a logger and creates a new, named sub-logger to use when running

func (*Config) WithReportingInterval

func (c *Config) WithReportingInterval(dur time.Duration) *Config

WithReportingInterval specifies the interval on which UsageMetricsReporter should emit metrics

func (*Config) WithStateProvider

func (c *Config) WithStateProvider(sp StateProvider) *Config

type StateProvider

type StateProvider interface {
	State() *state.Store
}

StateProvider defines an inteface for retrieving a state.Store handle. In non-test code, this is satisfied by the fsm.FSM struct.

type UsageMetricsReporter

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

UsageMetricsReporter provides functionality for emitting usage metrics into the metrics stream. This makes it essentially a translation layer between the state store and metrics stream.

func NewUsageMetricsReporter

func NewUsageMetricsReporter(cfg *Config) (*UsageMetricsReporter, error)

func (*UsageMetricsReporter) Run

func (u *UsageMetricsReporter) Run(ctx context.Context)

Run must be run in a goroutine, and can be stopped by closing or sending data to the passed in shutdownCh

Jump to

Keyboard shortcuts

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