Skip to content

Commit

Permalink
Better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorbin committed Jul 4, 2024
1 parent 78c91c2 commit 65b76df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func InitTLSHealthcheck(healthcheck *aggregates.Healthcheck) {
}

func (s *Service) CreateHealthcheck(ctx context.Context, healthcheck *aggregates.Healthcheck) error {
s.logger.Debug(fmt.Sprintf("creating healthcheck %s", healthcheck.Name))
s.logger.Info(fmt.Sprintf("creating healthcheck %s", healthcheck.Name))
interval, err := time.ParseDuration(healthcheck.Interval)
if err != nil {
return er.New("Invalid healthcheck interval", er.BadRequest, true)
Expand All @@ -66,7 +66,7 @@ func (s *Service) CreateHealthcheck(ctx context.Context, healthcheck *aggregates
}

func (s *Service) UpdateHealthcheck(ctx context.Context, healthcheck *aggregates.Healthcheck) error {
s.logger.Debug(fmt.Sprintf("updating healthcheck %s", healthcheck.Name))
s.logger.Info(fmt.Sprintf("updating healthcheck %s", healthcheck.Name))
err := validator.Validator.Struct(*healthcheck)
if err != nil {
return err
Expand Down Expand Up @@ -97,7 +97,7 @@ func (s *Service) GetHealthcheckByName(ctx context.Context, name string) (*aggre
}

func (s *Service) DeleteHealthcheck(ctx context.Context, id string) error {
s.logger.Debug(fmt.Sprintf("deleting healthcheck %s", id))
s.logger.Info(fmt.Sprintf("deleting healthcheck %s", id))
return s.store.DeleteHealthcheck(ctx, id)
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/pushgateway/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func InitPushgatewayMetric(metric *aggregates.PushgatewayMetric) {
}

func (s *Service) CreateOrUpdatePushgatewayMetric(ctx context.Context, metric aggregates.PushgatewayMetric, cumulative bool) (string, error) {
s.logger.Debug(fmt.Sprintf("creating or updating metric %s", metric.Name))
s.logger.Info(fmt.Sprintf("creating or updating metric %s", metric.Name))
return s.store.CreateOrUpdatePushgatewayMetric(ctx, metric, cumulative)
}

Expand Down Expand Up @@ -77,17 +77,17 @@ func (s *Service) PrometheusMetrics(ctx context.Context) (string, error) {
}

func (s *Service) DeleteMetricsByName(ctx context.Context, name string) error {
s.logger.Debug(fmt.Sprintf("deleting push gateway metric %s", name))
s.logger.Info(fmt.Sprintf("deleting push gateway metric %s", name))
return s.store.DeleteMetricsByName(ctx, name)
}

func (s *Service) DeleteMetricByID(ctx context.Context, id string) error {
s.logger.Debug(fmt.Sprintf("deleting push gateway metric %s", id))
s.logger.Info(fmt.Sprintf("deleting push gateway metric %s", id))
return s.store.DeleteMetricByID(ctx, id)
}

func (s *Service) DeleteAllPushgatewayMetrics(ctx context.Context) error {
s.logger.Debug("deleting all push gateway metrics")
s.logger.Info("deleting all push gateway metrics")
return s.store.DeleteAllPushgatewayMetrics(ctx)
}

Expand Down

0 comments on commit 65b76df

Please sign in to comment.