Skip to content

Commit

Permalink
Log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
cleege-kf committed Mar 7, 2023
1 parent 87920e7 commit 0c5129a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/sloth/commands/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ func (g Generator) GeneratePrometheus(ctx context.Context, slos prometheus.SLOGr
repo := prometheus.NewIOWriterGroupedRulesYAMLRepo(out, g.Logger)
storageSLOs := make([]prometheus.StorageSLO, 0, len(result.PrometheusSLOs))
for _, s := range result.PrometheusSLOs {
g.Logger.Infof(s.SLO.Name)
storageSLOs = append(storageSLOs, prometheus.StorageSLO{
SLO: s.SLO,
Rules: s.SLORules,
Expand Down
5 changes: 4 additions & 1 deletion src/prometheus/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ func (i IOWriterGroupedRulesYAMLRepo) StoreSLOs(ctx context.Context, slos []Stor
}

logger := i.logger.WithCtxValues(ctx)
logger.WithValues(log.Kv{"groups": len(ruleGroups.Groups)}).Infof("Prometheus rules written")
logger.Infof("test 1")
i.logger.Infof("test 2")
logger.WithValues(log.Kv{"groups": len(ruleGroups.Groups)}).Infof("Prometheus rules written 1")
i.logger.WithValues(log.Kv{"groups": len(ruleGroups.Groups)}).Infof("Prometheus rules written 2")

return nil
}
Expand Down

0 comments on commit 0c5129a

Please sign in to comment.