Documentation
¶
Index ¶
- func NewRouter(store *storage.DB, hub *ws.Hub, fwd *forwarder.Forwarder) http.Handler
- func NewRouterFull(store *storage.DB, hub *ws.Hub, fwd *forwarder.Forwarder, ...) http.Handler
- func NewRouterWithManifests(store *storage.DB, hub *ws.Hub, fwd *forwarder.Forwarder, ...) http.Handler
- type DiffResult
- type DiffSessionInfo
- type DiffSpan
- type DiffSummary
- type MetricSeriesPoint
- type MetricSeriesResponse
- type Router
- type SettingsResponse
- type SettingsRuntime
- type SettingsService
- type SettingsUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouterFull ¶
func NewRouterFull(store *storage.DB, hub *ws.Hub, fwd *forwarder.Forwarder, mfs *coverage.Manifests, settings *SettingsService) http.Handler
NewRouterFull is the canonical constructor. Pass nil for any optional dependency (manifests, settings) to disable the corresponding endpoints.
Types ¶
type DiffResult ¶
type DiffResult struct {
Baseline DiffSessionInfo `json:"baseline"`
Compare DiffSessionInfo `json:"compare"`
Summary DiffSummary `json:"summary"`
Spans []DiffSpan `json:"spans"`
BaselineSpans []*storage.Span `json:"baseline_spans"`
CompareSpans []*storage.Span `json:"compare_spans"`
}
type DiffSessionInfo ¶
type DiffSpan ¶
type DiffSpan struct {
Name string `json:"name"`
ServiceName string `json:"service_name"`
Status string `json:"status"` // added|removed|changed|unchanged
BaselineDurationNs int64 `json:"baseline_duration_ns"`
CompareDurationNs int64 `json:"compare_duration_ns"`
DeltaPct float64 `json:"delta_pct"`
Depth int `json:"depth"`
}
type DiffSummary ¶
type MetricSeriesPoint ¶
type MetricSeriesPoint struct {
TimestampNs int64 `json:"timestamp_ns"`
Value float64 `json:"value"`
Percentile string `json:"percentile,omitempty"`
}
MetricSeriesResponse is the shape returned by GET /api/metrics/series. Histogram percentiles arrive bucketed into p50/p95/p99 slices on the client; gauge/counter populate only Value.
type MetricSeriesResponse ¶
type MetricSeriesResponse struct {
Name string `json:"name"`
ServiceName string `json:"service_name"`
Type string `json:"type"`
Unit string `json:"unit"`
Description string `json:"description"`
Points []MetricSeriesPoint `json:"points"`
// Traces is populated only when ?with_traces=1 is passed. Always
// materialized as [] (never null) so the frontend type can be
// non-optional and rendering branches stay flat.
Traces []*storage.TraceOverlay `json:"traces"`
}
type SettingsResponse ¶
type SettingsResponse struct {
Port int `json:"port"`
DBPath string `json:"db_path"`
RetentionDays int `json:"retention_days"`
MaxSessions int `json:"max_sessions"`
MaxDBSizeMB int `json:"max_db_size_mb"`
OTLPGRPCPort int `json:"otlp_grpc_port"`
OTLPHTTPPort int `json:"otlp_http_port"`
NoBrowser bool `json:"no_browser"`
Forward []string `json:"forward"`
BindAddress string `json:"bind_address"`
ForwardSample float64 `json:"forward_sample"`
Runtime SettingsRuntime `json:"runtime"`
}
SettingsResponse is the JSON shape returned by GET /api/settings. Persistable fields live at the top level; read-only info is under Runtime.
type SettingsRuntime ¶
type SettingsRuntime struct {
PID int `json:"pid"`
UptimeNs int64 `json:"uptime_ns"`
Version string `json:"version"`
ConfigPath string `json:"config_path"`
OTLPGRPCPort int `json:"otlp_grpc_port"`
OTLPHTTPPort int `json:"otlp_http_port"`
DBSizeBytes int64 `json:"db_size_bytes"`
}
SettingsRuntime is everything the UI shows but never writes back.
type SettingsService ¶
type SettingsService struct {
Viper *viper.Viper
ConfigPath string // path to the file Save() will write
Version string
StartedAt time.Time
OTLPGRPCPort int
OTLPHTTPPort int
}
SettingsService is everything the settings endpoints need that isn't already on the Router (storage, hub, etc.). main.go builds one of these after viper has been bootstrapped and hands it to Router.SetSettingsService.
type SettingsUpdate ¶
type SettingsUpdate struct {
Port *int `json:"port,omitempty"`
DBPath *string `json:"db_path,omitempty"`
RetentionDays *int `json:"retention_days,omitempty"`
MaxSessions *int `json:"max_sessions,omitempty"`
MaxDBSizeMB *int `json:"max_db_size_mb,omitempty"`
OTLPGRPCPort *int `json:"otlp_grpc_port,omitempty"`
OTLPHTTPPort *int `json:"otlp_http_port,omitempty"`
NoBrowser *bool `json:"no_browser,omitempty"`
Forward *[]string `json:"forward,omitempty"`
BindAddress *string `json:"bind_address,omitempty"`
ForwardSample *float64 `json:"forward_sample,omitempty"`
}
SettingsUpdate is the writable subset accepted by PUT /api/settings. Pointer fields let clients send partial updates — nil = "leave as-is".