ss

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ss holds shared internal types for sseq.

Index

Constants

View Source
const (
	DefaultBatchSize     = 20
	DefaultFlushInterval = time.Second
	DefaultHTTPTimeout   = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchConfig

type BatchConfig struct {
	BatchSize     int
	FlushInterval time.Duration
}

BatchConfig controls asynchronous flush behavior.

type Encoder

type Encoder interface {
	Encode(event SpanEvent) ([]byte, error)
}

Encoder serializes span events for a provider.

type Sender

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

Sender batches encoded spans and flushes them through a Writer.

func NewSender

func NewSender(config BatchConfig, encoder Encoder, writer Writer) *Sender

NewSender creates an asynchronous span sender.

func (*Sender) Close

func (sender *Sender) Close() error

Close flushes buffered events and releases the writer.

func (*Sender) Send

func (sender *Sender) Send(event SpanEvent) error

Send encodes and queues a span event for delivery.

type SpanEvent

type SpanEvent struct {
	Name           string
	Application    string
	TraceID        string
	SpanID         string
	ParentID       string
	SpanKind       string
	StartTime      time.Time
	EndTime        time.Time
	HasError       bool
	StatusMessage  string
	HTTPStatusCode int
	Events         []TimedEvent
	Attributes     map[string]any
}

SpanEvent is a completed span ready for encoding and delivery.

type TimedEvent

type TimedEvent struct {
	Name       string
	Time       time.Time
	Attributes map[string]any
}

TimedEvent is a point-in-time annotation attached to a span.

type Writer

type Writer interface {
	WritePayload(payload []byte)
	Close() error
}

Writer delivers encoded payload batches.

Directories

Path Synopsis
providers
seq

Jump to

Keyboard shortcuts

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