feat(observabillity): #115 integrate otel for metrics and traces
Some checks failed
Build Docker Image / Build-Docker-Image (push) Has been cancelled

This commit is contained in:
2025-06-07 12:18:41 +02:00
parent 7efaa0fc61
commit e2ff1221ca
32 changed files with 480 additions and 314 deletions

View File

@@ -3,10 +3,15 @@ package middleware
import (
"net/http"
"strings"
"go.opentelemetry.io/otel"
)
func CacheControl(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
counter, _ := otel.Meter("").Int64Counter("spend.sparrow.test")
counter.Add(r.Context(), 1)
shouldCache := strings.HasPrefix(r.URL.Path, "/static")
if !shouldCache {