Skip to content

Commit

Permalink
return err when metrics project is not configured (#6064)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjain1 authored Nov 8, 2024
1 parent ebc928e commit 74a7eb5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions admin/server/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@ func (s *Server) GetBillingProjectCredentials(ctx context.Context, req *adminv1.
return nil, status.Error(codes.PermissionDenied, "not allowed to get metrics for this org")
}

if s.admin.MetricsProjectID == "" {
return nil, status.Error(codes.FailedPrecondition, "metrics project not configured")
}

metricsProj, err := s.admin.DB.FindProject(ctx, s.admin.MetricsProjectID)
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
Expand Down

0 comments on commit 74a7eb5

Please sign in to comment.