prometheus

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 11 Imported by: 1

README

Prometheus

Prometheus implements the prometheus exporter for gmqtt.
Default URL: 127.0.0.1:8082/metrics

Metrics

metric name Type Labels
gmqtt_clients_connected_total Counter
gmqtt_messages_dropped_total Counter qos: qos of the dropped message
gmqtt_packets_received_bytes_total Counter type: type of the packet
gmqtt_packets_received_total Counter type: type of the packet
gmqtt_packets_sent_bytes_total Counter type: type of the packet
gmqtt_packets_sent_total Counter type: type of the packet
gmqtt_sessions_created_total Counter
gmqtt_sessions_terminated_total Counter reason: the reason of termination. (expired
gmqtt_sessions_active_current Gauge
gmqtt_sessions_expired_total Counter
gmqtt_sessions_inactive_current Gauge
gmqtt_subscriptions_current Gauge
gmqtt_subscriptions_total Counter
gmqtt_messages_queued_current Gauge
gmqtt_messages_received_total Counter qos: qos of the message
gmqtt_messages_sent_total Counter qos: qos of the message

Documentation

Index

Constants

View Source
const (
	Name = "prometheus"
)

Variables

View Source
var DefaultConfig = Config{
	ListenAddress: ":8082",
	Path:          "/metrics",
}

DefaultConfig is the default configuration.

Functions

func New

func New(config config.Config) (server.Plugin, error)

Types

type Config added in v0.2.0

type Config struct {
	// ListenAddress is the address that the exporter will listen on.
	ListenAddress string `yaml:"listen_address"`
	// Path is the exporter url path.
	Path string `yaml:"path"`
}

Config is the configuration for the prometheus plugin.

func (*Config) UnmarshalYAML added in v0.2.0

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Config) Validate added in v0.2.0

func (c *Config) Validate() error

Validate validates the configuration, and return an error if it is invalid.

type Prometheus

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

Prometheus served as a prometheus exporter that exposes gmqtt metrics.

func (*Prometheus) Collect

func (p *Prometheus) Collect(m chan<- prometheus.Metric)

func (*Prometheus) Describe

func (p *Prometheus) Describe(desc chan<- *prometheus.Desc)

func (*Prometheus) HookWrapper

func (p *Prometheus) HookWrapper() server.HookWrapper

func (*Prometheus) Load

func (p *Prometheus) Load(service server.Server) error

func (*Prometheus) Name

func (p *Prometheus) Name() string

func (*Prometheus) Unload

func (p *Prometheus) Unload() error

Jump to

Keyboard shortcuts

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