Skip to content

Commit

Permalink
fix(profiler): Improve logging when profile creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
punya committed Jan 15, 2025
1 parent 0a81f8f commit bb126f4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions profiler/profiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (a *agent) createProfile(ctx context.Context) *pb.Profile {
var p *pb.Profile
md := grpcmd.New(nil)

gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
debugLog("creating a new profile via profiler service")
var err error
p, err = a.client.CreateProfile(ctx, &req, grpc.Trailer(&md))
Expand All @@ -361,7 +361,11 @@ func (a *agent) createProfile(ctx context.Context) *pb.Profile {
}
}))

debugLog("successfully created profile %v", p.GetProfileType())
if err != nil {
debugLog("failed to create new profile: %v", err)
} else {
debugLog("successfully created profile %v", p.GetProfileType())
}
return p
}

Expand Down

0 comments on commit bb126f4

Please sign in to comment.