Skip to content

Commit

Permalink
Fixes a weekly-report query that sometimes fails
Browse files Browse the repository at this point in the history
  • Loading branch information
foot committed Jan 31, 2019
1 parent 8a2ab26 commit 2f682d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions users/weeklyreports/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ const (
)

func buildWorkloadsResourceConsumptionQuery(resourceQuery string) string {
// FIXME: including job here is a bit of hack to make this work more consistently.
// Details: https://github.com/weaveworks/service/issues/2472. job
// appears to always be 'cadvisor'
return fmt.Sprintf(`
sort_desc(
sum by (namespace, service) (
%s * on (pod_name) group_left(namespace, service) (%s)
sum by (namespace, service, job) (
%s * on (pod_name) group_left(namespace, service, job) (%s)
)
)
`, resourceQuery, podsByWorkloadsQuery)
Expand Down

0 comments on commit 2f682d5

Please sign in to comment.