Skip to content

Commit

Permalink
Remove registration of old panicCounter
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Parraga <[email protected]>
  • Loading branch information
Sovietaced committed Jul 30, 2024
1 parent cad19e2 commit 9a1d7a8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 60 deletions.
13 changes: 0 additions & 13 deletions flyteadmin/pkg/rpc/adminservice/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"fmt"
"runtime/debug"

"github.com/golang/protobuf/proto"

"github.com/flyteorg/flyte/flyteadmin/pkg/async/cloudevent"
eventWriter "github.com/flyteorg/flyte/flyteadmin/pkg/async/events/implementations"
"github.com/flyteorg/flyte/flyteadmin/pkg/async/notifications"
Expand Down Expand Up @@ -44,17 +42,6 @@ type AdminService struct {
Metrics AdminMetrics
}

// Intercepts all admin requests to handle panics during execution.
func (m *AdminService) interceptPanic(ctx context.Context, request proto.Message) {
err := recover()
if err == nil {
return
}

m.Metrics.PanicCounter.Inc()
logger.Fatalf(ctx, "panic-ed for request: [%+v] with err: %v with Stack: %v", request, err, string(debug.Stack()))
}

const defaultRetries = 3

func NewAdminServer(ctx context.Context, pluginRegistry *plugins.Registry, configuration runtimeIfaces.Configuration,
Expand Down
40 changes: 0 additions & 40 deletions flyteadmin/pkg/rpc/adminservice/base_test.go

This file was deleted.

7 changes: 1 addition & 6 deletions flyteadmin/pkg/rpc/adminservice/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
package adminservice

import (
"github.com/prometheus/client_golang/prometheus"

"github.com/flyteorg/flyte/flyteadmin/pkg/rpc/adminservice/util"
"github.com/flyteorg/flyte/flytestdlib/promutils"
)
Expand Down Expand Up @@ -115,8 +113,7 @@ type descriptionEntityEndpointMetrics struct {
}

type AdminMetrics struct {
Scope promutils.Scope
PanicCounter prometheus.Counter
Scope promutils.Scope

executionEndpointMetrics executionEndpointMetrics
launchPlanEndpointMetrics launchPlanEndpointMetrics
Expand All @@ -137,8 +134,6 @@ type AdminMetrics struct {
func InitMetrics(adminScope promutils.Scope) AdminMetrics {
return AdminMetrics{
Scope: adminScope,
PanicCounter: adminScope.MustNewCounter("handler_panic",
"panics encountered while handling requests to the admin service"),

executionEndpointMetrics: executionEndpointMetrics{
scope: adminScope,
Expand Down
1 change: 0 additions & 1 deletion flyteadmin/pkg/rpc/adminservice/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (m *AdminService) GetProject(ctx context.Context, request *admin.ProjectGet
}

func (m *AdminService) GetDomains(ctx context.Context, request *admin.GetDomainRequest) (*admin.GetDomainsResponse, error) {
defer m.interceptPanic(ctx, request)
if request == nil {
return nil, status.Errorf(codes.InvalidArgument, "Incorrect request, nil requests not allowed")
}
Expand Down

0 comments on commit 9a1d7a8

Please sign in to comment.