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

Add on-demand tracer into resty #216

Closed
jeevatkm opened this issue Jan 10, 2019 · 2 comments
Closed

Add on-demand tracer into resty #216

jeevatkm opened this issue Jan 10, 2019 · 2 comments
Assignees
Labels
feature v2 For resty v2

Comments

@jeevatkm
Copy link
Member

There was the issue #205 created by Resty user. In the thread @moorereason have created a quick tracer implementation with resty #205 (comment).

Refer to gist https://gist.github.com/moorereason/f77d69a2c823fb222eba61c151e63a6b and implement one for the resty.

The goal is to provide following metrics via tracer with structured data format.

DNS Lookup 85.082359ms
TCP Connection 49.376838ms
Server Processing 64.521936ms
TLS Handshake 0s
Content Transfer 136.181µs
Total Time 199.162309ms
@jeevatkm
Copy link
Member Author

jeevatkm commented Mar 10, 2019

Structured trace info would look like -

// TraceInfo struct is used provide request trace info such as DNS lookup
// duration, Connection obtain duration, Server processing duration, etc.
//
// Since v2.0.0
type TraceInfo struct {
	// DNSLookup is a duration that transport took to perform
	// DNS lookup.
	DNSLookup time.Duration

	// ConnTime is a duration that took to obtain a successful connection.
	ConnTime time.Duration

	// TLSHandshake is a duration that TLS handshake took place.
	TLSHandshake time.Duration

	// ServerTime is a duration that server took to respond first byte.
	ServerTime time.Duration

	// ResponseTime is a duration since first response byte from server to
	// request completion.
	ResponseTime time.Duration

	// TotalTime is a duration that total request took end-to-end.
	TotalTime time.Duration

	// IsConnReused is whether this connection has been previously
	// used for another HTTP request.
	IsConnReused bool

	// IsConnWasIdle is whether this connection was obtained from an
	// idle pool.
	IsConnWasIdle bool

	// ConnIdleTime is a duration how long the connection was previously
	// idle, if IsConnWasIdle is true.
	ConnIdleTime time.Duration
}

@jeevatkm
Copy link
Member Author

It's done 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature v2 For resty v2
Development

No branches or pull requests

1 participant