Documentation
¶
Overview ¶
Package telemetry provides telemetry exporters for asyncmachine: am-dbg, Prometheus, and OpenTelemetry.
Index ¶
- Constants
- func TransitionsToDBG(mach *am.Machine, url string) error
- type DbgMsg
- type DbgMsgStruct
- type DbgMsgTx
- type OtelMachTracer
- func (ot *OtelMachTracer) End()
- func (ot *OtelMachTracer) HandlerEnd(tx *am.Transition, _ string, _ string)
- func (ot *OtelMachTracer) HandlerStart(tx *am.Transition, emitter string, handler string)
- func (ot *OtelMachTracer) Inheritable() bool
- func (ot *OtelMachTracer) MachineDispose(id string)
- func (ot *OtelMachTracer) MachineInit(mach *am.Machine)
- func (ot *OtelMachTracer) NewSubmachine(parent, mach *am.Machine)
- func (ot *OtelMachTracer) QueueEnd(*am.Machine)
- func (ot *OtelMachTracer) TransitionEnd(tx *am.Transition)
- func (ot *OtelMachTracer) TransitionInit(tx *am.Transition)
- type OtelMachTracerOpts
- type OtelMachineData
Constants ¶
View Source
const DbgHost = "localhost:6831"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DbgMsg ¶ added in v0.5.0
type DbgMsg interface {
// Clock returns the state's clock, using the passed index
Clock(statesIndex am.S, state string) uint64
// Is returns true if the state is active, using the passed index
Is(statesIndex am.S, states am.S) bool
}
DbgMsg is the interface for the messages to be sent to the am-dbg server.
type DbgMsgStruct ¶ added in v0.5.0
type DbgMsgStruct struct {
// Machine ID
ID string
// state names defining the indexes for diffs
StatesIndex am.S
// all the states with relations
States am.Struct
}
DbgMsgStruct contains the state and relations data.
type DbgMsgTx ¶ added in v0.5.0
type DbgMsgTx struct {
MachineID string
// Transition ID
ID string
// map of positions from the index to state clocks
Clocks am.T
// result of the transition
Accepted bool
// mutation type
Type am.MutationType
// called states
CalledStates []string
// all the transition steps
Steps []*am.Step
// log entries created during the transition
LogEntries []*am.LogEntry
// log entries before the transition, which happened after the prev one
PreLogEntries []*am.LogEntry
// transition was triggered by an auto state
IsAuto bool
// queue length at the start of the transition
Queue int
// don't send this over the wire
Time *time.Time
}
DbgMsgTx contains transition data.
type OtelMachTracer ¶ added in v0.5.0
type OtelMachTracer struct {
Tracer trace.Tracer
Machines map[string]*OtelMachineData
MachinesMx sync.Mutex
MachinesOrder []string
Logf func(format string, args ...any)
// contains filtered or unexported fields
}
OtelMachTracer implements machine.Tracer for OpenTelemetry. Support tracing multiple machines
func NewOtelMachTracer ¶ added in v0.5.0
func NewOtelMachTracer(tracer trace.Tracer, opts *OtelMachTracerOpts, ) *OtelMachTracer
NewOtelMachTracer creates a new machine tracer from an OpenTelemetry tracer. Requires OtelMachTracer.Dispose to be called at the end.
func (*OtelMachTracer) End ¶ added in v0.5.0
func (ot *OtelMachTracer) End()
func (*OtelMachTracer) HandlerEnd ¶ added in v0.5.0
func (ot *OtelMachTracer) HandlerEnd(tx *am.Transition, _ string, _ string)
func (*OtelMachTracer) HandlerStart ¶ added in v0.5.0
func (ot *OtelMachTracer) HandlerStart( tx *am.Transition, emitter string, handler string, )
func (*OtelMachTracer) Inheritable ¶ added in v0.5.0
func (ot *OtelMachTracer) Inheritable() bool
func (*OtelMachTracer) MachineDispose ¶ added in v0.5.0
func (ot *OtelMachTracer) MachineDispose(id string)
func (*OtelMachTracer) MachineInit ¶ added in v0.5.0
func (ot *OtelMachTracer) MachineInit(mach *am.Machine)
func (*OtelMachTracer) NewSubmachine ¶ added in v0.5.0
func (ot *OtelMachTracer) NewSubmachine(parent, mach *am.Machine)
NewSubmachine links 2 machines with a parent-child relationship.
func (*OtelMachTracer) QueueEnd ¶ added in v0.6.0
func (ot *OtelMachTracer) QueueEnd(*am.Machine)
func (*OtelMachTracer) TransitionEnd ¶ added in v0.5.0
func (ot *OtelMachTracer) TransitionEnd(tx *am.Transition)
func (*OtelMachTracer) TransitionInit ¶ added in v0.5.0
func (ot *OtelMachTracer) TransitionInit(tx *am.Transition)
type OtelMachTracerOpts ¶ added in v0.5.0
Directories
¶
| Path | Synopsis |
|---|---|
|
Package prometheus provides Prometheus metrics for asyncmachine.
|
Package prometheus provides Prometheus metrics for asyncmachine. |
Click to show internal directories.
Click to hide internal directories.