-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log: if there's a crash, final telemetry logs might not be sent #1203
Comments
A slightly better way I came up with for doing this is a variant of Care needs to be taken to properly handle the executable path (as well as injecting it into the args of the child), and also properly handling exit codes so that the orchestrator isn't confused by what we're doing. This is a PoC that shows the technique described: https://github.com/timraymond/dontpanic/blob/master/main.go |
Also, from @matmerr :
|
@timraymond @huntergregory I've had a quick look and I've a question on the legacy operator. retina/operator/cmd/legacy/deployment.go Line 173 in f858e84
It's littered with os.Exit, which will ignore the defers. What's the best approach here? For a quick win should we defer all the os.Exit calls too? |
@mereta yeah, that's... not great. It will probably work to just replace those |
EDIT: there is a method
ShutdownAppInsights()
which is deferred in a few places in the legacy agent and hubble-based agent. Also viaTrackPanic()
e.g. here. However, panics in go routines withoutTrackPanic()
might result in missing telemetry.To ensure logs are sent in case of Retina's Application Insights implementation, operator should issue a
ShutdownAppInsights()
call.Stretch Goal
A stretch goal would be to ensure
ShutdownAppInsights()
before/after all panics. Relevant links:The text was updated successfully, but these errors were encountered: