Skip to content

stats: statistics on request and response body size#4433

Closed
zyfjeff wants to merge 5 commits intoenvoyproxy:masterfrom
zyfjeff:statistics_body_size
Closed

stats: statistics on request and response body size#4433
zyfjeff wants to merge 5 commits intoenvoyproxy:masterfrom
zyfjeff:statistics_body_size

Conversation

@zyfjeff
Copy link
Copy Markdown
Member

@zyfjeff zyfjeff commented Sep 15, 2018

Signed-off-by: tianqian.zyf [email protected]

Description: statistics on request and response body size
Risk Level: low
Testing: unittest
Docs Changes: yes
Release Notes: N/A
[Optional Fixes #Issue] #3621
[Optional Deprecated:]

@zyfjeff zyfjeff force-pushed the statistics_body_size branch from 950ec26 to 339b850 Compare September 15, 2018 13:22
@htuch htuch requested a review from dnoe September 17, 2018 02:48
@zyfjeff zyfjeff force-pushed the statistics_body_size branch from e0da368 to 4837b77 Compare September 17, 2018 11:11
Signed-off-by: zyfjeff <[email protected]>
Signed-off-by: zyfjeff <[email protected]>
Signed-off-by: zyfjeff <[email protected]>
upstream_cx_destroy_local_with_active_rq, Counter, Total connections destroyed locally with 1+ active request
upstream_cx_destroy_remote_with_active_rq, Counter, Total connections destroyed remotely with 1+ active request
upstream_cx_close_notify, Counter, Total connections closed via HTTP/1.1 connection close header or HTTP/2 GOAWAY
upstream_cx_rx_bytes_total, Histogram, Size of received connection bytes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this say upstream_cx_rx_bytes? and below?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thank you, misspelled

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it needs to be fixed here too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sorry, I check again carefully

@zyfjeff zyfjeff force-pushed the statistics_body_size branch from 790e878 to 295f0ec Compare September 19, 2018 15:14
Signed-off-by: zyfjeff <[email protected]>
@dnoe
Copy link
Copy Markdown
Contributor

dnoe commented Sep 19, 2018

Assigning @zuercher for senior review.

Copy link
Copy Markdown
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

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

This doesn't seem to actually resolve the referenced ticket (#3621). This is recording a histogram of the size of read and write buffers. Those values are related to the request/response body size, but they're not the same. Partly the distinction is the size of headers in HTTP requests, but also there's no guarantee Envoy will receive an entire request (or request body) in a single read.

This seems like it might be useful for the tcp proxy (since there's no way to distinguish requests there), but for HTTP and redis, tracking the size of actual requests & responses seems more useful to me.


downstream_cx_total, Counter, Total number of connections handled by the filter
downstream_cx_no_route, Counter, Number of connections for which no matching route was found or the cluster for the route was not found
downstream_cx_tx_bytes, Histogram, Bytes written to the downstream connection
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Should say "Size of bytes written" (and "Size of bytes read" below) to match the others.

@zuercher
Copy link
Copy Markdown
Member

@zyfjeff are you still working on this?

@zyfjeff
Copy link
Copy Markdown
Member Author

zyfjeff commented Sep 27, 2018

@zuercher Is looking at the code and see how to count the body size, don't know what do you suggest?

@zuercher
Copy link
Copy Markdown
Member

zuercher commented Oct 1, 2018

@zyfjeff I apologize, but I don't understand what you're asking. Could you restate it?

In the meantime, I can give you some information that might help. The HTTP connection manager/router already track the number of bytes received and sent at the request level (it's stored in RequestInfo). The HTTP router also tracks the bytes received and sent for each proxied upstream request in a separate RequestInfo. Perhaps it's sufficient to expose those as stats? (We'd probably want to ask the original issue author.) Request body size tracking could be done in a similar way.

@stale
Copy link
Copy Markdown

stale bot commented Oct 8, 2018

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Oct 8, 2018
@zyfjeff
Copy link
Copy Markdown
Member Author

zyfjeff commented Oct 10, 2018

At present the implementation of the knowledge of each socket read data size, is not really the size of a request, does not meet the demand, so the close off the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants