Documentation
¶
Overview ¶
Package prometheus provides Prometheus metrics for asyncmachine. Metrics are collected from machine's transitions and states.
Index ¶
Constants ¶
View Source
const EnvPromPushUrl = "AM_PROM_PUSH_URL"
Variables ¶
This section is empty.
Functions ¶
func BindToPusher ¶ added in v0.8.0
func BindToRegistry ¶ added in v0.8.0
func BindToRegistry(metrics *Metrics, registry *prometheus.Registry)
Types ¶
type Metrics ¶
type Metrics struct {
// Tracer is a Prometheus tracer for the machine. You can detach it any time
// using Machine.DetachTracer.
Tracer am.Tracer
// 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
// number of transitions
TransitionsCount 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 asyncmachine.
func MachMetricsEnv ¶ added in v0.10.3
MachMetricsEnv bind an OpenTelemetry tracer to [mach], based on environment variables: - AM_SERVICE (required) - AM_PROM_PUSH_URL (required)
This tracer is inherited by submachines, and this function applies only to top-level machines.
func (*Metrics) SetRegistry ¶ added in v0.10.3
func (m *Metrics) SetRegistry(registry *prometheus.Registry)
type PromInheritTracer ¶ added in v0.10.3
type PromInheritTracer struct {
*am.TracerNoOp
// contains filtered or unexported fields
}
type PromTracer ¶ added in v0.8.0
type PromTracer struct {
*am.TracerNoOp
// contains filtered or unexported fields
}
PromTracer is am.Tracer for tracing state machines.
func (*PromTracer) MachineDispose ¶ added in v0.8.0
func (t *PromTracer) MachineDispose(machId string)
func (*PromTracer) NewSubmachine ¶ added in v0.10.3
func (t *PromTracer) NewSubmachine(parent, mach am.Api)
func (*PromTracer) SchemaChange ¶ added in v0.11.0
func (t *PromTracer) SchemaChange(machine am.Api, old am.Schema)
func (*PromTracer) TransitionEnd ¶ added in v0.8.0
func (t *PromTracer) TransitionEnd(tx *am.Transition)
func (*PromTracer) TransitionInit ¶ added in v0.8.0
func (t *PromTracer) TransitionInit(tx *am.Transition)
Click to show internal directories.
Click to hide internal directories.