feat: implement observability and metrics (Task 22)
- Add metrics package tracking cache hit-rate, API quota, circuit breaker trips, search time - Integrate metrics with cache layer, yandex client, and API handlers - Add /metrics HTTP endpoint for Prometheus-compatible metrics exposure - Write tests for metrics functionality across cache, yandex, and API handlers - Update test files to support new metrics infrastructure
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/go-redis/redis/v8"
|
||||
|
||||
"trip-planner/internal/cache"
|
||||
"trip-planner/internal/metrics"
|
||||
"trip-planner/internal/yandex"
|
||||
)
|
||||
|
||||
@@ -19,7 +20,7 @@ func newMockMonitor(id string, tripCount int, scheduleFunc func(context.Context,
|
||||
monitor := &StationMonitor{
|
||||
ID: id,
|
||||
Yandex: yc,
|
||||
Cache: cache.NewCacheStore(rc),
|
||||
Cache: cache.NewCacheStore(rc, metrics.New()),
|
||||
ScheduleFunc: scheduleFunc,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user