forked from mtusi2026/mtusi2026lab6
feat: add bounded observability and verified SLO incident alerts
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package fiber
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// HTTPObserver consumes only safe transport metadata and W3C context.
|
||||
type HTTPObserver interface {
|
||||
// Start begins a server operation and returns its completion callback.
|
||||
Start(context.Context, string, string) (context.Context, func(error))
|
||||
// Extract restores the upstream W3C parent without baggage.
|
||||
Extract(context.Context, string, string) context.Context
|
||||
// HTTP observes the completed response using a route template.
|
||||
HTTP(context.Context, string, string, int, time.Duration, string)
|
||||
}
|
||||
|
||||
// WithObserver installs optional instrumentation before the HTTP listener starts.
|
||||
func (ctrl *Controller) WithObserver(observer HTTPObserver) *Controller {
|
||||
ctrl.observer = observer
|
||||
return ctrl
|
||||
}
|
||||
Reference in New Issue
Block a user