feat: add X-Instance-Id header and instance_id log field

This commit is contained in:
kk10
2026-10-17 10:09:31 +03:00
parent cd6a1c7aee
commit dc79ef5e1f
4 changed files with 34 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
package middleware
import (
"net/http"
)
func InstanceID(id string) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Instance-Id", id)
next.ServeHTTP(w, r)
})
}
}