Skip to content

Commit

Permalink
trivial. remove debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
ktkfree committed Jun 2, 2023
1 parent 40845dc commit 90cc054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/delivery/http/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/openinfradev/tks-api/internal/helper"
"github.com/openinfradev/tks-api/internal/usecase"
"github.com/openinfradev/tks-api/pkg/domain"
"github.com/openinfradev/tks-api/pkg/httpErrors"
Expand Down Expand Up @@ -99,9 +100,6 @@ func (h *AlertHandler) GetAlerts(w http.ResponseWriter, r *http.Request) {
log.InfoWithContext(r.Context(), err)
}

//out.Alerts[i].RawData = fmt.Sprintf("%s", alert.RawData)
log.InfoWithContext(r.Context(), alert.FiredAt)

outAlertActions := make([]domain.AlertActionResponse, len(alert.AlertActions))
for j, alertAction := range alert.AlertActions {
if err := domain.Map(alertAction, &outAlertActions[j]); err != nil {
Expand Down Expand Up @@ -235,6 +233,8 @@ func (h *AlertHandler) CreateAlertAction(w http.ResponseWriter, r *http.Request)
return
}

log.InfoWithContext(r.Context(), "alert : ", helper.ModelToJson(input))

var dto domain.AlertAction
if err = domain.Map(input, &dto); err != nil {
log.InfoWithContext(r.Context(), err)
Expand Down
6 changes: 4 additions & 2 deletions internal/usecase/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ func (u *AlertUsecase) Create(ctx context.Context, input domain.CreateAlertReque
if appGroup.AppGroupType == domain.AppGroupType_LMA {
applications, err := u.appGroupRepo.GetApplications(appGroup.ID, domain.ApplicationType_GRAFANA)
if err != nil {
continue
break
}
if len(applications) > 0 {
grafanaUrl = applications[0].Endpoint
grafanaUrl = applications[0].Endpoint + "/d/tks-kubernetes/tks-kubernetes-view-cluster-global?var-taco_cluster=" + clusterId + "&kiosk"
log.InfoWithContext(ctx, "grafanaUrl : ", grafanaUrl)
break
}
}
}
Expand Down

0 comments on commit 90cc054

Please sign in to comment.