feat(ops): protect metrics, rate-limit auth, agent secret timing, e2e smoke
Bearer для /metrics (EVOBGP_METRICS_TOKEN); rate limit /v1/auth/config; constant-time agent secret; OTel stub; Playwright smoke; HTTP_PROXY note; checklist обновлён. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package observability
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"evobgp/internal/logging"
|
||||
)
|
||||
|
||||
// StartOTelIfEnabled is an opt-in stub for OpenTelemetry (EVOBGP_OTEL_ENDPOINT).
|
||||
// Full exporter wiring lands when the ops stack provides a collector; this logs intent only.
|
||||
func StartOTelIfEnabled(ctx context.Context) (shutdown func(context.Context) error) {
|
||||
ep := strings.TrimSpace(os.Getenv("EVOBGP_OTEL_ENDPOINT"))
|
||||
if ep == "" {
|
||||
return func(context.Context) error { return nil }
|
||||
}
|
||||
logging.Default().Info("otel opt-in enabled (stub; export not wired yet)", "endpoint", ep)
|
||||
_ = ctx
|
||||
return func(context.Context) error { return nil }
|
||||
}
|
||||
Reference in New Issue
Block a user