Skip to content

Commit 86f45a0

Browse files
committed
debug
1 parent a6c9c1a commit 86f45a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

coderd/prometheusmetrics/insights/metricscollector.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"context"
55
"time"
66

7-
"cdr.dev/slog"
87
"github.com/prometheus/client_golang/prometheus"
98
"golang.org/x/xerrors"
109

10+
"cdr.dev/slog"
11+
1112
"github.com/coder/coder/v2/coderd/database"
1213
)
1314

@@ -52,15 +53,18 @@ func (mc *MetricsCollector) Run(ctx context.Context) (func(), error) {
5253

5354
now := time.Now()
5455

56+
// TODO collect iteration time
57+
5558
parameterRows, err := mc.database.GetTemplateInsights(ctx, database.GetTemplateInsightsParams{
5659
StartTime: now.Add(-mc.duration),
5760
EndTime: now,
5861
})
5962
if err != nil {
60-
mc.logger.Error(ctx, "unable to fetch template insights from database: %w", err)
63+
mc.logger.Error(ctx, "unable to fetch template insights from database", slog.Error(err))
6164
return
6265
}
6366

67+
mc.logger.Info(ctx, "debug", slog.F("parameter_rows", parameterRows))
6468
}
6569

6670
go func() {

0 commit comments

Comments
 (0)