File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 44 "context"
55 "encoding/hex"
66
7+ "go.opentelemetry.io/otel"
78 api "go.opentelemetry.io/otel/metric"
89
910 "github.com/cespare/xxhash/v2"
@@ -15,6 +16,8 @@ import (
1516 base "github.com/Permify/permify/pkg/pb/base/v1"
1617)
1718
19+ var tracer = otel .Tracer ("check-cache" )
20+
1821// CheckEngineWithCache is a struct that holds an instance of a cache.Cache for managing engine cache.
1922type CheckEngineWithCache struct {
2023 // schemaReader is responsible for reading schema information
@@ -69,6 +72,9 @@ func (c *CheckEngineWithCache) Check(ctx context.Context, request *base.Permissi
6972
7073 // If a cached result is found, handle exclusion and return the result.
7174 if found {
75+ ctx , span := tracer .Start (ctx , "hit" )
76+ defer span .End ()
77+
7278 // Increase the check count in the metrics.
7379 c .cacheCounter .Add (ctx , 1 )
7480 // If the request doesn't have the exclusion flag set, return the cached result.
You can’t perform that action at this time.
0 commit comments