feat(observabillity): #115 integrate otel for metrics and traces
This commit was merged in pull request #152.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user