MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / initSentry

Function initSentry

app/artifact-cas/cmd/main.go:155–177  ·  view source on GitHub ↗
(c *conf.Bootstrap, logger log.Logger)

Source from the content-addressed store, hash-verified

153}
154
155func initSentry(c *conf.Bootstrap, logger log.Logger) (cleanupFunc func(), err error) {
156 cleanupFunc = func() {
157 sentry.Flush(2 * time.Second)
158 }
159
160 if c.Observability == nil || c.Observability.Sentry == nil {
161 return
162 }
163
164 sentryOpts := c.Observability.Sentry
165 err = sentry.Init(sentry.ClientOptions{
166 Dsn: sentryOpts.Dsn,
167 Environment: sentryOpts.Environment,
168 Release: Version,
169 AttachStacktrace: true,
170 })
171
172 if err == nil {
173 _ = logger.Log(log.LevelInfo, "msg", "Sentry initialized", "environment", sentryOpts.Environment, "release", Version)
174 }
175
176 return
177}

Callers 1

mainFunction · 0.70

Calls 1

InitMethod · 0.65

Tested by

no test coverage detected