feat: sentry integration
All checks were successful
arcad/emissary/pipeline/head This commit looks good

This commit is contained in:
2023-10-13 12:30:52 +02:00
parent 9068203e71
commit e756a60373
27 changed files with 272 additions and 67 deletions

View File

@ -10,6 +10,7 @@ import (
"forge.cadoles.com/Cadoles/emissary/internal/agent"
"forge.cadoles.com/Cadoles/emissary/internal/spec"
"github.com/getsentry/sentry-go"
"github.com/pkg/errors"
"gitlab.com/wpetit/goweb/logger"
)
@ -145,7 +146,9 @@ func (c *Controller) writeState(ctx context.Context, state *agent.State) error {
return
}
logger.Error(ctx, "could not remove temporary file", logger.E(errors.WithStack(err)))
err = errors.WithStack(err)
logger.Error(ctx, "could not remove temporary file", logger.E(err))
sentry.CaptureException(err)
}
}()
@ -155,7 +158,9 @@ func (c *Controller) writeState(ctx context.Context, state *agent.State) error {
return
}
logger.Error(ctx, "could not close temporary file", logger.E(errors.WithStack(err)))
err = errors.WithStack(err)
logger.Error(ctx, "could not close temporary file", logger.E(err))
sentry.CaptureException(err)
}
}()