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

Emit HTTP timings #2989

Merged
merged 6 commits into from
Sep 17, 2024
Merged

Emit HTTP timings #2989

merged 6 commits into from
Sep 17, 2024

Conversation

patrobinson
Copy link
Contributor

@patrobinson patrobinson commented Sep 13, 2024

Description

When debugging network timeouts it can be useful to have detailed timings to know where specifically the time being consumed.

Changes

Add a TraceHTTP flag (only on agent start for now).
Use http trace to capture timings between each network event In the case of a network error emit this to error log. Otherwise emit it to the debug logs.

Example:

2024-09-17 09:31:11 DEBUG  HTTP Timing Trace uri=https://agent.buildkite.com/v3/ping method=GET hostPort=agent.buildkite.com:443 getConn=746.458µs dnsStart=773.625µs dnsDone=5.492208ms connectStart.tcp.3.168.86.46:443=5.502791ms connectDone.tcp.3.168.86.46:443=169.197333ms tlsHandshakeStart=169.207541ms tlsHandshakeDone=337.926125ms gotConn=337.964208ms reused=false idle=false idleTime=0s wroteHeaders=337.995208ms wroteRequest=337.995791ms gotFirstResponseByte=665.737916ms agent_version=3.81.0+x..dirty

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)

With the TraceHTTP flag enabled, use http trace to capture timings between each network event
In the case of a network error emit this to error log
Otherwise emit it to the debug logs
Not sure why this is being imported now but CI fails without it
@wolfeidau
Copy link
Contributor

@patrobinson are you going to include the status code? or even entire status?

network should always be tcp, but addr should be unique
This will avoid emmitting invalid JSON
@patrobinson patrobinson merged commit 9129581 into main Sep 17, 2024
1 check passed
@patrobinson patrobinson deleted the trace-http-timings branch September 17, 2024 01:09
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.

3 participants