Skip to content
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

Allow env vars to control debug logging for the lambda #238

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Nov 29, 2023

For some reason, these were hard coded to be off. Now, they can be controlled with env vars.
For the non lambda mode, there are already command line arguments for these.

@triarius triarius requested a review from a team November 29, 2023 06:32
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💹

@@ -57,6 +57,12 @@ func Handler(ctx context.Context, evt json.RawMessage) (string, error) {
quiet := quietString == "1" || quietString == "true"
timeout := os.Getenv("BUILDKITE_AGENT_METRICS_TIMEOUT")

debugEnvVar := os.Getenv("BUILDKITE_AGENT_METRICS_DEBUG")
debug := debugEnvVar == "1" || debugEnvVar == "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, one day, we should use strconv.ParseBool for all these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda wish it were stricter, if it only accepted "true" and "false" and errored on everything else, I would be more happy.

@triarius triarius merged commit 4a78f0f into master Dec 4, 2023
1 check passed
@triarius triarius deleted the pdp-1952-allow-debugging-in-the-lambda branch December 4, 2023 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants