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

Adding more debug traces for HTTP and enhance security #283

Merged
merged 3 commits into from
May 27, 2024

Conversation

CheeseStick
Copy link
Contributor

Background

To debug sudden spiking delay while collecting and processing metrics, it was required to collect more metrics during the HTTP requests.

Also, we noticed that the agent token is exposed to the log when HTTP debug is enabled, which can be a security risk.

This PR

It adds more traces to the HTTP Client tracer for more detailed event timing. Also, it updates the request dump to redact the Authorisation header if it exists.

collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
collector/collector.go Outdated Show resolved Hide resolved
CheeseStick and others added 3 commits May 27, 2024 16:21
- Updating debug request to redact Authorisation header.
* `return nil` instead of `return err` where `err` is unrelated
* `if err != nil` rather than `if err == nil`
* more precise token redaction
log.Print includes a timestamp by default, and debug logging is stderr-flavoured output. The only tweaks needed are to log with more precise timestamps
@DrJosh9000 DrJosh9000 force-pushed the junjung/adding-more-logs branch from 60b1f35 to d78130f Compare May 27, 2024 06:22
@DrJosh9000 DrJosh9000 merged commit e89164f into buildkite:master May 27, 2024
1 check passed
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