package prometheus

Import Path
	/pkg/telemetry/prometheus (on go.dev)

Dependency Relation
	imports 10 packages, and imported by 2 packages

Involved Source Files Package prometheus provides Prometheus metrics for asyncmachine. Metrics are collected from machine's transitions and states.
Package-Level Type Names (total 3)
/* sort by: | */
Metrics is a set of Prometheus metrics for asyncmachine. number of errors amount of executed handlers per tx current number of queued transitions (per transition) number of state referenced by relations for all registered states number of relations for all registered states number of active states (per transition) number of states added (per transition) number of registered states number of inactive states (per transition) number of states removed (per transition) number of states touched (per transition) steps per transition Tracer is a Prometheus tracer for the machine. You can detach it any time using Machine.DetachTracer. number of transitions transition duration in machine's clock (ticks per tx) transition time Close sets all gauges to 0. (*Metrics) SetPusher(pusher *push.Pusher) (*Metrics) SetRegistry(registry *prometheus.Registry) Sync synchronizes the metrics with the current counters, averaging certain values and using totals of others. After that the counters are reset to 0. Sync should be called right before pushing or scraping. func BindMach(mach am.Api) *Metrics func MachMetricsEnv(mach am.Api) *Metrics func BindToPusher(metrics *Metrics, pusher *push.Pusher) func BindToRegistry(metrics *Metrics, registry *prometheus.Registry)
TracerNoOp *am.TracerNoOp ( PromInheritTracer) HandlerEnd(transition *machine.Transition, emitter string, handler string) ( PromInheritTracer) HandlerStart(transition *machine.Transition, emitter string, handler string) ( PromInheritTracer) Inheritable() bool ( PromInheritTracer) MachineDispose(machID string) ( PromInheritTracer) MachineInit(machine machine.Api) context.Context ( PromInheritTracer) MutationQueued(machine machine.Api, mutation *machine.Mutation) ( PromInheritTracer) NewSubmachine(parent, machine machine.Api) ( PromInheritTracer) QueueEnd(machine machine.Api) ( PromInheritTracer) SchemaChange(machine machine.Api, old machine.Schema) ( PromInheritTracer) TransitionEnd(transition *machine.Transition) ( PromInheritTracer) TransitionFinals(transition *machine.Transition) ( PromInheritTracer) TransitionInit(transition *machine.Transition) ( PromInheritTracer) TransitionStart(transition *machine.Transition) ( PromInheritTracer) VerifyStates(machine machine.Api) PromInheritTracer : github.com/pancsta/asyncmachine-go/pkg/machine.Tracer
PromTracer is [am.Tracer] for tracing state machines. TracerNoOp *am.TracerNoOp ( PromTracer) HandlerEnd(transition *machine.Transition, emitter string, handler string) ( PromTracer) HandlerStart(transition *machine.Transition, emitter string, handler string) ( PromTracer) Inheritable() bool (*PromTracer) MachineDispose(machId string) ( PromTracer) MachineInit(machine machine.Api) context.Context ( PromTracer) MutationQueued(machine machine.Api, mutation *machine.Mutation) (*PromTracer) NewSubmachine(parent, mach am.Api) ( PromTracer) QueueEnd(machine machine.Api) (*PromTracer) SchemaChange(machine am.Api, old am.Schema) (*PromTracer) TransitionEnd(tx *am.Transition) ( PromTracer) TransitionFinals(transition *machine.Transition) (*PromTracer) TransitionInit(tx *am.Transition) ( PromTracer) TransitionStart(transition *machine.Transition) ( PromTracer) VerifyStates(machine machine.Api) *PromTracer : github.com/pancsta/asyncmachine-go/pkg/machine.Tracer
Package-Level Functions (total 4)
BindMach bind transitions to Prometheus metrics.
func BindToPusher(metrics *Metrics, pusher *push.Pusher)
func BindToRegistry(metrics *Metrics, registry *prometheus.Registry)
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.
Package-Level Constants (only one)
const EnvPromPushUrl = "AM_PROM_PUSH_URL"