-
Notifications
You must be signed in to change notification settings - Fork 3
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
[POA-1340] Add a mechanism to randomly _not_ start apidump. #17
Conversation
Controlled by a flag and a new environment variable.
The environment variable is not working and I can't tell why:
|
Another problem here is that Go prior to 1.20 does not seed its RNG automatically. And we use 1.18 to build. |
select {} | ||
|
||
// Unreachable | ||
os.Exit(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will this be called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never, that's why it's marked unreachable (and the linter will tell you so too.)
I just felt it was more robust to have it here in case the select was later modified.
if prob < 100 { | ||
printer.Stdout.Infof("Starting trace with probability %d%%.\n", prob) | ||
|
||
// Pre-1.20, Go does not seed the default Random object :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should create a ticket to upgrade agent to build on go 1.21
Controlled by a flag and a new environment variable.
The use case here is that we want to run the agent but some, but not all, of the pods in a critical deployment. This is not a great solution, but it's much easier than the alternatives considered. The deployment can include a probability as an environment variable that any given apidump command will run; those that don't run will just hang forever to avoid any problems caused by container exit.
One downside is that changing the environment variable causes all the pods to be restarted.