From 861478d08ccb8ce116276afd38090d4ee5de244a Mon Sep 17 00:00:00 2001 From: "taekyu.kang" Date: Wed, 15 Nov 2023 15:39:17 +0900 Subject: [PATCH] trivial. add log --- internal/route/route.go | 2 +- pkg/thanos-client/client.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/route/route.go b/internal/route/route.go index f5ecbd4a..e82d6214 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -64,7 +64,7 @@ func SetupRouter(db *gorm.DB, argoClient argowf.ArgoClient, kc keycloak.IKeycloa authenticator.NewAuthenticator(authKeycloak.NewKeycloakAuthenticator(kc)), authorizer.NewDefaultAuthorization(repoFactory)) - cache := gcache.New(time.Hour, time.Hour) + cache := gcache.New(5*time.Minute, 10*time.Minute) r.Use(loggingMiddleware) diff --git a/pkg/thanos-client/client.go b/pkg/thanos-client/client.go index 61a602b7..1a6994a5 100644 --- a/pkg/thanos-client/client.go +++ b/pkg/thanos-client/client.go @@ -46,6 +46,8 @@ func New(host string, port int, ssl bool, token string) (ThanosClient, error) { func (c *ThanosClientImpl) Get(query string) (out Metric, err error) { url := c.url + "/api/v1/query?query=" + url.QueryEscape(query) + + log.Info("url : ", url) res, err := c.client.Get(url) if err != nil { return out, err