telemetry

package
v0.0.0-...-11e1b04 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TelemetryConfig

type TelemetryConfig struct {
	// Categories limits which event categories are captured.
	// nil or empty captures all user-facing categories plus system events.
	Categories []oapi.TelemetryEventCategory
}

TelemetryConfig holds caller-supplied telemetry preferences. All fields are optional; zero values mean "use server defaults" (all user-facing categories plus system events).

type TelemetrySession

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

TelemetrySession manages a telemetry session against a shared EventStream. It category-filters Publish calls, tracks session-scoped metadata (ID, config, timestamps), and embeds telemetry_session_id into Event.Source.Metadata before forwarding to the bus.

A *TelemetrySession is required to be non-nil: NewTelemetrySession panics on a nil EventStream and ApiService construction rejects a nil session. Callers should not nil-check.

func NewTelemetrySession

func NewTelemetrySession(es *events.EventStream) *TelemetrySession

func (*TelemetrySession) Active

func (s *TelemetrySession) Active() bool

Active reports whether a telemetry session is currently running.

func (*TelemetrySession) AppliedAt

func (s *TelemetrySession) AppliedAt() time.Time

AppliedAt returns when the current configuration was applied, or the zero time if telemetry is not configured.

func (*TelemetrySession) Config

func (s *TelemetrySession) Config() TelemetryConfig

Config returns the current telemetry configuration.

func (*TelemetrySession) ID

func (s *TelemetrySession) ID() string

ID returns the current telemetry session ID, or "" if no session is active.

func (*TelemetrySession) NewReader

func (s *TelemetrySession) NewReader(afterSeq uint64) *events.Reader

NewReader returns a Reader from the EventStream positioned after afterSeq.

func (*TelemetrySession) Publish

func (s *TelemetrySession) Publish(ev events.Event) (events.Envelope, bool)

Publish applies the telemetry config filter and forwards ev to the EventStream. Returns the assigned envelope and true on success, or a zero envelope and false when the event was dropped (session inactive or category disabled). Fire-and-forget callers can ignore the returns.

func (*TelemetrySession) Seq

func (s *TelemetrySession) Seq() uint64

Seq returns the sequence number of the last published event.

func (*TelemetrySession) SessionStartSeq

func (s *TelemetrySession) SessionStartSeq() uint64

SessionStartSeq returns the sequence number at which the current session started. Fresh SSE connections with no Last-Event-ID should begin here.

func (*TelemetrySession) Start

func (s *TelemetrySession) Start(telemetrySessionID string, cfg TelemetryConfig)

Start begins a new telemetry session with the given ID and config. Sequence numbers are process-monotonic and do not reset between sessions; a Last-Event-ID from any previous session is valid for resuming the SSE stream.

func (*TelemetrySession) Stop

func (s *TelemetrySession) Stop()

Stop ends the current telemetry session. The ring buffer is left intact so existing readers can finish draining.

func (*TelemetrySession) UpdateConfig

func (s *TelemetrySession) UpdateConfig(cfg TelemetryConfig)

UpdateConfig applies a new TelemetryConfig to the running session.

Jump to

Keyboard shortcuts

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