Реализовать lab3 в общем Helm-релизе с Traefik, TLS и HPA

This commit is contained in:
Vladislav Agapov
2026-10-16 11:51:20 +03:00
parent a57cbcf329
commit 9494547300
88 changed files with 1922 additions and 255 deletions
@@ -16,12 +16,18 @@ import (
// request assigns a request identifier, handles errors and logs the completed request.
func (ctrl *Controller) request(ctx *fiber.Ctx) error {
ctx.Set(headerRequestID, uuid.NewString())
ctx.Set("X-Instance-Id", ctrl.instanceID)
started := time.Now()
ctrl.metrics.active.Inc()
defer ctrl.metrics.active.Dec()
err := ctx.Next()
if err != nil {
err = ctrl.handleErr(ctx, err)
}
ctrl.logRequest(ctx, time.Since(started))
if ctx.Path() != "/metrics" {
ctrl.metrics.observe(ctx, time.Since(started))
}
return err
}