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 traffic size metrics #9208
Merged
traefiker
merged 12 commits into
traefik:master
from
tomMoulard:feat/traffic-size-metrics
Sep 12, 2022
Merged
Add traffic size metrics #9208
traefiker
merged 12 commits into
traefik:master
from
tomMoulard:feat/traffic-size-metrics
Sep 12, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tomMoulard
added
kind/enhancement
a new or improved feature.
status/1-needs-design-review
area/middleware/metrics
labels
Jul 25, 2022
rtribotte
force-pushed
the
feat/traffic-size-metrics
branch
from
August 10, 2022 10:33
930a352
to
8e06f93
Compare
mmatur
reviewed
Sep 7, 2022
tomMoulard
force-pushed
the
feat/traffic-size-metrics
branch
from
September 7, 2022 15:33
8169cb2
to
c9b781c
Compare
rtribotte
force-pushed
the
feat/traffic-size-metrics
branch
from
September 12, 2022 12:03
fe27bb8
to
9e00a33
Compare
This commit superseeds the PR from @OmarElawady by adding `bytes_sent` and `bytes_received` metrics for all metric backend. It refactors the access log middleware to use the new capture middleware. This new capture middleware extract request/response size and store it in the request context. As pilot is deprecated, this commit does not add support for this metric backend.
Co-authored-by: Michael <mmatur@users.noreply.github.com>
kevinpollet
force-pushed
the
feat/traffic-size-metrics
branch
from
September 12, 2022 14:21
e09c96d
to
2f515fe
Compare
rtribotte
approved these changes
Sep 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
mpl
approved these changes
Sep 12, 2022
kevinpollet
approved these changes
Sep 12, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR superseeds the PR #8432 from @OmarElawady by adding
requests_bytes
andresponses_bytes
metrics for all metric backend.It refactors the access log middleware to use the new capture middleware.
This new capture middleware extracts request/response size and stores it in the request context.
There might be a memory leak introduced by using the
http.Request
contexts: golang/go#50798As pilot is deprecated, this PR does not add support for this metric backend.
Motivation
This PR resolves #7804.
More
Additional Notes
Benchmarks with and without metrics
The following output display benchmarks of the capture middleware were:
captured
measure the response sizebody
measure the response and request sizeCo-authored-by: OmarElawady omarelawady1998@gmail.com
Co-authored-by: Mathieu Lonjaret mathieu.lonjaret@gmail.com
Co-authored-by: Romain rtribotte@users.noreply.github.com