Node: Initialize scissors metrics

Change-Id: I018a663aa5b9ea902f934ab71c23b1786c8aeeb0
This commit is contained in:
Bruce Riley 2023-01-27 19:45:32 +00:00 committed by Evan Gray
parent c6593ededf
commit c585810766
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ var (
// Start a go routine with recovering from any panic by sending an error to a error channel
func RunWithScissors(ctx context.Context, errC chan error, name string, runnable supervisor.Runnable) {
go func() {
ScissorsErrors.WithLabelValues("scissors", name).Add(0)
defer func() {
if r := recover(); r != nil {
switch x := r.(type) {
@ -41,6 +42,7 @@ func RunWithScissors(ctx context.Context, errC chan error, name string, runnable
func WrapWithScissors(runnable supervisor.Runnable, name string) supervisor.Runnable {
return func(ctx context.Context) (result error) {
ScissorsErrors.WithLabelValues("scissors", name).Add(0)
defer func() {
if r := recover(); r != nil {
switch x := r.(type) {