-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add EventSource/EventCounter tracing and metrics for Kestrel #4769
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
Comments
Backlogging based on the discussion with @DamianEdwards the other day. |
FWIW, I'd like to see this incorporated into a app.UseMetrics("/metrics") helper similar to how app.UseHealthChecks() works. Then it would be easy to build a grafana dashboard for all our kestrel based apps. |
For the Number of open WebSockets also would be handy |
- Connection queue length - This is the amount of connections accepted and queued in the thread pool. - Connection count - The number of connections - Total connections - The total number of connections ever connected. - Connection Rate - Connections per second Contributes to #4769
* Added some kestrel event counters - Connection queue length - This is the amount of connections accepted and queued in the thread pool. - Connection count - The number of connections - Total connections - The total number of connections ever connected. - Connection Rate - Connections per second * Added TLS counters - Current TLS handshakes - Total TLS handshakes - Failed TLS handshakes - TLS handshake per second * Added HTTP/2 queue length counter * Improve the event information - Add TLS version to handshake events - Add HTTP version to request queue events - Renamed HTTP/2 request queue length to http request queue Contributes to #4769
We think we're done here |
Some of the events/counters to add (some may already exist, others may be valuable too, discuss below):
Informational
level).ConnectionStart
event & counter - Triggered on a new connection.ConnectionStop
event & counter - Triggered on graceful termination of a connection.ConnectionAbort
event & counter- Triggered when a connection is terminated abnormally.ConnectionReject
event & counter - Triggered when a connection is terminated because a limit was exhausted.ConnectionTimeOut
event & counter- Triggered when a connection is terminated by the server because it timed out.ConnectionDuration
counter - Measures the length of time a connection is established forConcurrentConnections
counter - Measures the number of concurrent connections (recorded each time a connection is established/terminated).RequestStart
event & counter - Triggered when a request is startedRequestStop
event & counter - Triggered when a request is completed (includes response status code)RequestAbort
event & counter - Triggered when a request is terminated abnormallyRequestTimeOut
event & counter - Triggered when a request is times outRequestFailure
event & counter - Triggered when an exception escapes from the middleware pipeline.RequestsSucceeded
counter - Counts the number of requests that ended with 2xx-class status codesRequestsRedirected
counter - Counts the number of requests that ended with 3xx-class status codes (this does include 304 Not Modified, but the 3xx class is called "Redirection" in the spec, and isn't a 304 just a redirection to the cache? :P)RequestsRejected
counter - Counts the number of requests that ended with 4xx-class status codesRequestsFailed
counter - Counts the number of requests that ended with 5xx-class status codesRequestsUpgraded
counter - Counts the number of requests that ended with the 101 Switching Protocols status code.RequestDuration
counter - Measures the length of time a request takes to process. (May need to be measured in Kestrel and servers because of flushing)RequestBytesRead
counter - Counts the number of bytes read for HTTP requests.ResponseBytesWritten
counter - Counts the number of bytes written for HTTP responses.It might be worth coordinating across HttpSysServer and IISIntegration to share code. Also, benchmarking the impact of disabled EventSources will be important. Obviously, avoiding regression of benchmarking scenarios is an extremely high priority, we may need to have some tricks ready for that.
See https://gist.github.com/anurse/af1859663ac91c6cf69c820cebe92303 for some guidance on adding EventSources and EventCounters to ASP.NET projects.
The text was updated successfully, but these errors were encountered: