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:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
|
||||
"trip-planner/internal/metrics"
|
||||
"trip-planner/internal/airports"
|
||||
"trip-planner/internal/routing"
|
||||
"trip-planner/internal/storage"
|
||||
@@ -54,7 +55,7 @@ func newMockHandlerContext() *HandlerContext {
|
||||
// Create Yandex client
|
||||
yandexClient := yandex.NewClient("test-key")
|
||||
|
||||
return NewHandlerContext(redisClient, router, yandexClient)
|
||||
return NewHandlerContext(redisClient, router, yandexClient, metrics.New())
|
||||
}
|
||||
|
||||
func TestHandlerCityAutocomplete(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user