Documentation
¶
Index ¶
- Constants
- func EnabledForLogLevel(level string) bool
- func EventKey(event Event) string
- func NewTraceID() string
- func ShouldMarkSlow(scope string, kind string, durationMs int64) bool
- func TraceIDFromContext(ctx context.Context) string
- func WithTraceID(ctx context.Context, traceID string) context.Context
- type Event
- type Options
- type Snapshot
- type Stats
- type StatusWriter
- func (w *StatusWriter) Flush()
- func (w *StatusWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *StatusWriter) Push(target string, opts *http.PushOptions) error
- func (w *StatusWriter) ReadFrom(r io.Reader) (int64, error)
- func (w *StatusWriter) StatusCode() int
- func (w *StatusWriter) Unwrap() http.ResponseWriter
- func (w *StatusWriter) Write(body []byte) (int, error)
- func (w *StatusWriter) WriteHeader(statusCode int)
- type Store
- type SummaryItem
Constants ¶
View Source
const ( SourceAgent = "agent" SourceDesktop = "desktop" TraceHeader = "X-Redeven-Debug-Trace-ID" EnabledHeader = "X-Redeven-Debug-Console-Enabled" ScopeDesktopHTTP = "desktop_http" ScopeDesktopLifecycle = "desktop_lifecycle" ScopeLocalUIHTTP = "localui_http" ScopeGatewayAPI = "gateway_api" ScopeDirectSession = "direct_session" ScopeCodexBridge = "codex_bridge" )
Variables ¶
This section is empty.
Functions ¶
func EnabledForLogLevel ¶
func NewTraceID ¶
func NewTraceID() string
func TraceIDFromContext ¶
Types ¶
type Event ¶
type Event struct {
CreatedAt string `json:"created_at"`
Source string `json:"source,omitempty"`
Scope string `json:"scope"`
Kind string `json:"kind"`
TraceID string `json:"trace_id,omitempty"`
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
StatusCode int `json:"status_code,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
Slow bool `json:"slow,omitempty"`
Message string `json:"message,omitempty"`
Detail map[string]any `json:"detail,omitempty"`
}
func MergeEvents ¶
type Snapshot ¶
type Snapshot struct {
RecentEvents []Event `json:"recent_events"`
SlowSummary []SummaryItem `json:"slow_summary"`
Stats Stats `json:"stats"`
}
type Stats ¶
type Stats struct {
TotalEvents int `json:"total_events"`
AgentEvents int `json:"agent_events"`
DesktopEvents int `json:"desktop_events"`
SlowEvents int `json:"slow_events"`
TraceCount int `json:"trace_count"`
}
func BuildStats ¶
type StatusWriter ¶
type StatusWriter struct {
http.ResponseWriter
// contains filtered or unexported fields
}
func NewStatusWriter ¶
func NewStatusWriter(w http.ResponseWriter) *StatusWriter
func (*StatusWriter) Flush ¶
func (w *StatusWriter) Flush()
func (*StatusWriter) Hijack ¶
func (w *StatusWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*StatusWriter) Push ¶
func (w *StatusWriter) Push(target string, opts *http.PushOptions) error
func (*StatusWriter) StatusCode ¶
func (w *StatusWriter) StatusCode() int
func (*StatusWriter) Unwrap ¶
func (w *StatusWriter) Unwrap() http.ResponseWriter
func (*StatusWriter) WriteHeader ¶
func (w *StatusWriter) WriteHeader(statusCode int)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) SetEnabled ¶
type SummaryItem ¶
type SummaryItem struct {
Scope string `json:"scope"`
Kind string `json:"kind,omitempty"`
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
Count int `json:"count"`
SlowCount int `json:"slow_count"`
MaxDurationMs int64 `json:"max_duration_ms"`
AvgDurationMs int64 `json:"avg_duration_ms"`
LastStatusCode int `json:"last_status_code,omitempty"`
LastSeenAt string `json:"last_seen_at,omitempty"`
}
func BuildSlowSummary ¶
func BuildSlowSummary(events []Event, limit int) []SummaryItem
Click to show internal directories.
Click to hide internal directories.