Documentation
¶
Index ¶
- type TelemetryConfig
- type TelemetrySession
- func (s *TelemetrySession) Active() bool
- func (s *TelemetrySession) AppliedAt() time.Time
- func (s *TelemetrySession) CategoryEnabled(c oapi.TelemetryEventCategory) bool
- func (s *TelemetrySession) Config() TelemetryConfig
- func (s *TelemetrySession) DroppedEvents() uint64
- func (s *TelemetrySession) ExcludedCdpMethods() map[string]struct{}
- 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) RecordDropped(n uint64)
- 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 events.DefaultCategories. Monitor is added automatically when
// any CDP category is present and is not configurable here.
Categories []oapi.TelemetryEventCategory
// ExportOTLP forwards captured events to the configured OTLP endpoint.
// Off by default and independent of what is captured.
ExportOTLP bool
// ExcludedCdpMethods leaves the named browser-control methods out of the
// cdp_command stream. Empty reports every supported method. Telemetry only:
// an excluded command still reaches the browser.
ExcludedCdpMethods []oapi.BrowserCdpCommandMethod
}
TelemetryConfig holds caller-supplied telemetry preferences. All fields are optional; zero values mean "use server defaults" (events.DefaultCategories).
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) CategoryEnabled ¶
func (s *TelemetrySession) CategoryEnabled(c oapi.TelemetryEventCategory) bool
CategoryEnabled reports whether events in category c are currently captured. It returns false when no session is active. Lock-free, so a caller on the CDP forwarding path can check it per frame; Publish re-checks under mu.
func (*TelemetrySession) Config ¶
func (s *TelemetrySession) Config() TelemetryConfig
Config returns the current telemetry configuration.
func (*TelemetrySession) DroppedEvents ¶
func (s *TelemetrySession) DroppedEvents() uint64
DroppedEvents returns the cumulative gap count across consumers.
func (*TelemetrySession) ExcludedCdpMethods ¶
func (s *TelemetrySession) ExcludedCdpMethods() map[string]struct{}
ExcludedCdpMethods returns the methods left out of the cdp_command stream. Lock-free for the same reason CategoryEnabled is; the returned set is read-only and may be nil.
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) RecordDropped ¶
func (s *TelemetrySession) RecordDropped(n uint64)
RecordDropped notes that a consumer found a gap of n envelopes in the stream.
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.