-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: parse state directly instead of using tf show (#391)
also: - enable pprof - add tracing - remove readonly logic (was no longer being used, as we lock every time)
- Loading branch information
1 parent
9d615ed
commit f84ef6e
Showing
19 changed files
with
182 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package interceptors | ||
|
||
import ( | ||
"context" | ||
"google.golang.org/grpc" | ||
"runtime/trace" | ||
) | ||
|
||
func TraceUnaryInterceptor() grpc.UnaryServerInterceptor { | ||
return TraceInterceptor | ||
} | ||
|
||
func TraceInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { | ||
ctx, task := trace.NewTask(ctx, "request") | ||
trace.Log(ctx, "method", info.FullMethod) | ||
defer task.End() | ||
// Invoke the original method call | ||
return handler(ctx, req) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.