prometheus

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 4 Imported by: 0

README

Prometheus

Test duration chart

pkg/telemetry/prometheus binds to machine's transactions and averages the values withing an interval exposing various metrics. Combined with Grafana, it can be used to monitor the metrics of you machines.

Metrics:

  • queue size
  • states: active, inactive, added, removed
  • transition duration (machine time)
  • transition duration (normal time)
  • transition's steps amount
  • exceptions count
  • registered states

Grafana dashboards can be:

  • generated using task gen-grafana-dashboard IDS=mach1,mach2
  • or imported from assets

Documentation

Overview

Package prometheus provides Prometheus metrics for asyncmachine. The metrics are collected from the machine's transitions and states.

Exported metrics: - states amount - relations amount - rel referenced states

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {

	// number of registered states
	StatesAmount prometheus.Gauge

	// number of relations for all registered states
	RelAmount prometheus.Gauge

	// number of state referenced by relations for all registered states
	RefStatesAmount prometheus.Gauge

	// current number of queued transitions (per transition)
	QueueSize prometheus.Gauge

	// transition duration in machine's clock (ticks per tx)
	TxTick prometheus.Gauge

	// number of active states (per transition)
	StatesActiveAmount prometheus.Gauge

	// number of inactive states (per transition)
	StatesInactiveAmount prometheus.Gauge

	// number of states added (per transition)
	StatesAdded prometheus.Gauge

	// number of states removed (per transition)
	StatesRemoved prometheus.Gauge

	// number of states touched (per transition)
	StatesTouched prometheus.Gauge

	// number of errors
	ExceptionsCount prometheus.Gauge

	// steps per transition
	StepsAmount prometheus.Gauge

	// amount of executed handlers per tx
	HandlersAmount prometheus.Gauge

	// transition time
	TxTime prometheus.Gauge
	// contains filtered or unexported fields
}

Metrics is a set of Prometheus metrics for a machine.

func TransitionsToPrometheus

func TransitionsToPrometheus(
	mach *machine.Machine, interval time.Duration,
) *Metrics

TransitionsToPrometheus bind transitions to Prometheus metrics. TODO debounce TODO bind via the tracer API (so it can be disabled/enabled)

func (*Metrics) Close

func (m *Metrics) Close()

Close sets all gauges to 0.

func (*Metrics) Refresh

func (m *Metrics) Refresh()

Refresh updates averages values from the interval and updates the gauges.

Jump to

Keyboard shortcuts

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