tracing

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlowIDBundle added in v1.15.0

func FlowIDBundle(b *bundle.Environment) *bundle.Environment

FlowIDBundle modifies a provided bundle environment so that all inputs are wrapped to ensure flow IDs are initialized on all messages. This is independent of tracing and should be applied to all builds.

Types

type EventType

type EventType string

EventType describes the type of event a component might experience during a config run.

var (
	EventProduce EventType = "PRODUCE"
	EventConsume EventType = "CONSUME"
	EventDelete  EventType = "DELETE"
	EventError   EventType = "ERROR"
)

Various event types.

type NodeEvent

type NodeEvent struct {
	Type      EventType
	Content   string
	Meta      map[string]any
	FlowID    string
	Timestamp time.Time
}

NodeEvent represents a single event that occurred within the stream.

func EventConsumeOf

func EventConsumeOf(part *message.Part) NodeEvent

EventConsumeOf creates a consumed event from a message part.

func EventDeleteOf deprecated

func EventDeleteOf() NodeEvent

EventDeleteOf creates a deleted event from a message part.

Deprecated: Use EventDeleteOfPart instead. This function cannot track flow IDs.

func EventDeleteOfPart added in v1.15.0

func EventDeleteOfPart(part *message.Part) NodeEvent

EventDeleteOfPart creates a deleted event with flow ID from a message part.

func EventErrorOf deprecated

func EventErrorOf(err error) NodeEvent

EventErrorOf creates an error event from a message part.

Deprecated: Use EventErrorOfPart instead. This function cannot track flow IDs.

func EventErrorOfPart added in v1.15.0

func EventErrorOfPart(part *message.Part, err error) NodeEvent

EventErrorOfPart creates an error event with flow ID from a message part.

func EventProduceOf

func EventProduceOf(part *message.Part) NodeEvent

EventProduceOf creates a produce event from a message part.

type Summary

type Summary struct {
	Input           uint64
	Output          uint64
	ProcessorErrors uint64
	// contains filtered or unexported fields
}

Summary is a high level description of all traced events.

func NewSummary

func NewSummary() *Summary

NewSummary creates a new tracing summary that can be passed to component constructors for adding traces.

func TracedBundle

func TracedBundle(b *bundle.Environment) (*bundle.Environment, *Summary)

TracedBundle modifies a provided bundle environment so that traceable components are wrapped by components that add trace events to the returned summary.

func (*Summary) InputEvents

func (s *Summary) InputEvents(flush bool) map[string][]NodeEvent

InputEvents returns a map of input labels to events traced during the execution of a stream pipeline. Set flush to true in order to clear the events after obtaining them.

func (*Summary) OutputEvents

func (s *Summary) OutputEvents(flush bool) map[string][]NodeEvent

OutputEvents returns a map of output labels to events traced during the execution of a stream pipeline.

func (*Summary) ProcessorEvents

func (s *Summary) ProcessorEvents(flush bool) map[string][]NodeEvent

ProcessorEvents returns a map of processor labels to events traced during the execution of a stream pipeline.

func (*Summary) SetEnabled

func (s *Summary) SetEnabled(e bool)

SetEnabled sets whether tracing events are enabled across the stream.

func (*Summary) SetEventLimit

func (s *Summary) SetEventLimit(n int64)

SetEventLimit sets a limit as to how many event traces are stored, this limit is per component that's traced.

Jump to

Keyboard shortcuts

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