Documentation
¶
Index ¶
- type TelemetryConfig
- type TelemetrySession
- func (s *TelemetrySession) Active() bool
- func (s *TelemetrySession) AppliedAt() time.Time
- func (s *TelemetrySession) Config() TelemetryConfig
- func (s *TelemetrySession) ID() string
- func (s *TelemetrySession) NewReader(afterSeq uint64) *events.Reader
- func (s *TelemetrySession) Publish(ev events.Event) (events.Envelope, bool)
- func (s *TelemetrySession) Seq() uint64
- func (s *TelemetrySession) SessionStartSeq() uint64
- func (s *TelemetrySession) Start(telemetrySessionID string, cfg TelemetryConfig)
- func (s *TelemetrySession) Stop()
- func (s *TelemetrySession) UpdateConfig(cfg TelemetryConfig)
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 ¶
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.