observability

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivityWorkflowBuild    = "workflow.build"
	ActivityWorkflowSession  = "workflow.session"
	ActivityWorkflowInvoke   = "workflow_invoke"
	ActivityMessageSend      = "message.send"
	ActivityExecutorProcess  = "executor.process"
	ActivityEdgeGroupProcess = "edge_group.process"

	EventBuildStarted             = "build.started"
	EventBuildValidationCompleted = "build.validation_completed"
	EventBuildCompleted           = "build.completed"
	EventBuildError               = "build.error"
	EventSessionStarted           = "session.started"
	EventSessionCompleted         = "session.completed"
	EventSessionError             = "session.error"
	EventWorkflowStarted          = "workflow.started"
	EventWorkflowCompleted        = "workflow.completed"
	EventWorkflowError            = "workflow.error"

	TagWorkflowID              = "workflow.id"
	TagWorkflowName            = "workflow.name"
	TagWorkflowDescription     = "workflow.description"
	TagWorkflowDefinition      = "workflow.definition"
	TagBuildErrorMessage       = "build.error.message"
	TagBuildErrorType          = "build.error.type"
	TagErrorType               = "error.type"
	TagErrorMessage            = "error.message"
	TagSessionID               = "session.id"
	TagExecutorID              = "executor.id"
	TagExecutorType            = "executor.type"
	TagExecutorInput           = "executor.input"
	TagExecutorOutput          = "executor.output"
	TagMessageType             = "message.type"
	TagMessageContent          = "message.content"
	TagEdgeGroupType           = "edge_group.type"
	TagMessageSourceID         = "message.source_id"
	TagMessageTargetID         = "message.target_id"
	TagEdgeGroupDelivered      = "edge_group.delivered"
	TagEdgeGroupDeliveryStatus = "edge_group.delivery_status"
)

Variables

This section is empty.

Functions

func BuildErrorAttributes

func BuildErrorAttributes(err error) []workflowobservability.Attribute

func ContextWithTelemetry

func ContextWithTelemetry(ctx context.Context, telemetry *Context) context.Context

func ErrorAttributes

func ErrorAttributes(err error) []workflowobservability.Attribute

func SerializedAttribute

func SerializedAttribute(key string, value any) workflowobservability.Attribute

func SetBuildWorkflowAttributes

func SetBuildWorkflowAttributes(span *Activity, metadata WorkflowMetadata, definition any)

Types

type Activity

type Activity struct {
	// contains filtered or unexported fields
}

func (*Activity) AddErrorEvent

func (s *Activity) AddErrorEvent(name string, err error)

func (*Activity) AddEvent

func (s *Activity) AddEvent(name string, attrs ...workflowobservability.Attribute)

func (*Activity) CaptureError

func (s *Activity) CaptureError(err error)

func (*Activity) End

func (s *Activity) End()

func (*Activity) SetAttributes

func (s *Activity) SetAttributes(attrs ...workflowobservability.Attribute)

func (*Activity) SetDeliveryStatus

func (s *Activity) SetDeliveryStatus(status DeliveryStatus)

type Context

type Context struct {
	// contains filtered or unexported fields
}

func Disabled

func Disabled() *Context

func FromContext

func FromContext(ctx context.Context) *Context

func New

func New(options Options) *Context

func (*Context) ExtractTraceContext

func (c *Context) ExtractTraceContext(ctx context.Context) map[string]string

func (*Context) IsEnabled

func (c *Context) IsEnabled() bool

func (*Context) SetExecutorOutput

func (c *Context) SetExecutorOutput(span *Activity, output any)

func (*Context) StartEdgeGroupProcess

func (c *Context) StartEdgeGroupProcess(ctx context.Context, metadata EdgeGroupMetadata) (context.Context, *Activity)

func (*Context) StartExecutorProcess

func (c *Context) StartExecutorProcess(ctx context.Context, executorID, executorType, messageType string, message any, traceContext map[string]string) (context.Context, *Activity)

func (*Context) StartMessageSend

func (c *Context) StartMessageSend(ctx context.Context, sourceID, targetID string, message any) (context.Context, *Activity)

func (*Context) StartWorkflowBuild

func (c *Context) StartWorkflowBuild(ctx context.Context) (context.Context, *Activity)

func (*Context) StartWorkflowRun

func (c *Context) StartWorkflowRun(ctx context.Context, metadata WorkflowMetadata) (context.Context, *Activity)

func (*Context) StartWorkflowSession

func (c *Context) StartWorkflowSession(ctx context.Context, metadata WorkflowMetadata) (context.Context, *Activity)

type DeliveryStatus

type DeliveryStatus string
const (
	DeliveryStatusDelivered             DeliveryStatus = "delivered"
	DeliveryStatusDroppedTypeMismatch   DeliveryStatus = "dropped type mismatch"
	DeliveryStatusDroppedTargetMismatch DeliveryStatus = "dropped target mismatch"
	DeliveryStatusDroppedConditionFalse DeliveryStatus = "dropped condition false"
	DeliveryStatusException             DeliveryStatus = "exception"
	DeliveryStatusBuffered              DeliveryStatus = "buffered"
)

type EdgeGroupMetadata

type EdgeGroupMetadata struct {
	Type     string
	SourceID string
	TargetID string
}

type Options

type Options struct {
	Tracer workflowobservability.Tracer

	// EnableSensitiveData includes serialized message inputs, outputs, and
	// message contents in span attributes. It is disabled by default.
	EnableSensitiveData bool

	DisableWorkflowBuild    bool
	DisableWorkflowRun      bool
	DisableExecutorProcess  bool
	DisableEdgeGroupProcess bool
	DisableMessageSend      bool
}

type WorkflowMetadata

type WorkflowMetadata struct {
	ID          string
	Name        string
	Description string
	SessionID   string
}

Jump to

Keyboard shortcuts

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