telemetry

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReceivedLogs = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: prometheusNamespace,
		Name:      "received_log_count",
		Help:      "The total number of Raft logs sent for application to the fsm",
	})
	LastFSMSnapshot = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: prometheusNamespace,
		Name:      "last_fsm_snapshot",
		Help:      "The unix time in seconds when the last fsm snapshot was taken",
	})
	PulledTasks = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: prometheusNamespace,
		Name:      "pulled_task_total",
		Help:      "The total number of tasks sent to clients",
	}, []string{"method", "queue"})
	PushedTasks = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: prometheusNamespace,
		Name:      "pushed_task_total",
		Help:      "The total number of tasks pushed from clients to the server",
	}, []string{"method", "queue"})
	RemovedTasks = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: prometheusNamespace,
		Name:      "removed_task_total",
		Help:      "The total number of tasks removed from the queue",
	}, []string{"method", "queue"})
	IsLeader = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: prometheusNamespace,
		Name:      "is_leader",
		Help:      "A boolean value that indicates if a peer is the cluster leader",
	})
)
View Source
var Logger *zap.Logger

Logger is the global logger.

Clients should use this directly after it has been configured with the InitLogger method.

Functions

func InitLogger

func InitLogger(debugEnabled bool) error

InitLogger initializes Logger.

Enabling debug logging will display logs in a more readable format in addition to displaying debug-level logs and above.

func LogRequestID

func LogRequestID(id string) zap.Field

LogRequestID returns a zap log field for http request IDs.

func StartPromServer

func StartPromServer(port int) error

StartPromServer exposes prometheus metrics on the given port.

Types

This section is empty.

Jump to

Keyboard shortcuts

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