mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-11 08:30:03 +08:00
Returning a 404 if no metrics are found.
This commit is contained in:
@@ -2,6 +2,8 @@ package server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/onepanelio/core/pkg/util"
|
||||||
|
"google.golang.org/grpc/codes"
|
||||||
"math"
|
"math"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -189,6 +191,9 @@ func (s *WorkflowServer) GetWorkflowExecutionMetrics(ctx context.Context, req *a
|
|||||||
Format: m.Format,
|
Format: m.Format,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if len(apiMetrics) == 0 {
|
||||||
|
return nil, util.NewUserError(codes.NotFound, "Metrics were not found.")
|
||||||
|
}
|
||||||
|
|
||||||
return &api.GetWorkflowExecutionMetricsResponse{Metrics: apiMetrics}, nil
|
return &api.GetWorkflowExecutionMetricsResponse{Metrics: apiMetrics}, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user