Documentation
¶
Overview ¶
Package monitoring owns process-local, client-facing bridge telemetry. The snapshot wire contract is shared with proxy/internal/monitoring.
Index ¶
- func Establish(ctx context.Context, role string)
- func Ignore(ctx context.Context)
- func Listen(ctx context.Context, r *Registry, addr, token string) error
- func PrivateHandler(r *Registry, token string) http.Handler
- func WithSession(ctx context.Context, s *Session) context.Context
- type Connection
- type Metadata
- type Registry
- type Session
- type Snapshot
- type Traffic
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateHandler ¶
PrivateHandler requires a dedicated shared token even when workspace auth is disabled.
Types ¶
type Connection ¶
type Connection struct {
Metadata
ID string `json:"id"`
State string `json:"state"`
StartedAt time.Time `json:"started_at"`
ConnectedAt *time.Time `json:"connected_at,omitempty"`
LastActivity *time.Time `json:"last_activity,omitempty"`
ToWorkspace uint64 `json:"to_workspace_bytes"`
ToClient uint64 `json:"to_client_bytes"`
MediaObserved bool `json:"media_observed"`
GuestAdmitted bool `json:"guest_admitted"`
}
type Metadata ¶
type Metadata struct {
WorkspaceUID string `json:"workspace_uid"`
Namespace string `json:"namespace"`
Name string `json:"name"`
WorkspaceType string `json:"workspace_type"`
Category string `json:"category"`
Transport string `json:"transport"`
Tier string `json:"tier,omitempty"`
Role string `json:"role,omitempty"`
User string `json:"user,omitempty"`
ByteLayer string `json:"byte_layer"`
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) ServeMetrics ¶
func (r *Registry) ServeMetrics(w http.ResponseWriter, _ *http.Request)
func (*Registry) ServeSnapshot ¶
func (r *Registry) ServeSnapshot(w http.ResponseWriter, _ *http.Request)
type Snapshot ¶
type Snapshot struct {
SetupFailures uint64 `json:"setup_failures"`
Protocol int `json:"protocol"`
Component string `json:"component"`
Owner string `json:"owner"`
BootID string `json:"boot_id"`
ObservedAt time.Time `json:"observed_at"`
Connections []Connection `json:"connections"`
Traffic []Traffic `json:"traffic"`
}
type Writer ¶
type Writer struct {
http.ResponseWriter
Session *Session
AutoUpgrade bool
// contains filtered or unexported fields
}
Writer preserves upgrades and streaming. Hijacked traffic is WebSocket stream bytes (including framing/control frames), not TCP packets or media payload.
func (*Writer) Unwrap ¶
func (w *Writer) Unwrap() http.ResponseWriter
func (*Writer) WriteHeader ¶
Click to show internal directories.
Click to hide internal directories.