Skip to content

feat: expose app insights as Prometheus metrics #10346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Nov 7, 2023
Merged
Prev Previous commit
Next Next commit
Try one more time
  • Loading branch information
mtojek committed Nov 7, 2023
commit 3afec057dfa10438d231dc20fe467ddec2cc51bd
2 changes: 1 addition & 1 deletion coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2411,7 +2411,7 @@ func (q *FakeQuerier) GetTemplateAppInsightsByTemplate(ctx context.Context, arg
}

t := s.SessionStartedAt.Truncate(time.Minute)
sessionEndedAt := s.SessionEndedAt.Add(-time.Microsecond).Truncate(time.Minute)
sessionEndedAt := s.SessionEndedAt.Truncate(time.Minute)
if t.Before(arg.StartTime) {
t = arg.StartTime
}
Expand Down
2 changes: 1 addition & 1 deletion coderd/prometheusmetrics/insights/metricscollector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestCollectInsights(t *testing.T) {
SlugOrPort: "golden-slug",
SessionID: uuid.New(),
SessionStartedAt: time.Now().Add(-3 * time.Minute),
SessionEndedAt: time.Now().Add(-time.Minute),
SessionEndedAt: time.Now().Add(-time.Minute).Add(-time.Second),
Requests: 1,
},
})
Expand Down