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 gzip middleware to frontend HTTP endpoints #1080

Merged
merged 8 commits into from
Nov 9, 2021

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Oct 26, 2021

What this PR does:

Which issue(s) this PR fixes:
Fixes #891

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@zalegrala zalegrala changed the title Http gzip compression Add gzip middleware to frontend HTTP endpoints Oct 26, 2021
@zalegrala zalegrala marked this pull request as ready for review October 27, 2021 14:36
Copy link
Contributor

@mdisibio mdisibio left a comment

Choose a reason for hiding this comment

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

Lgtm, but defer approval to another maintainer that is more familiar with the query path.

@joe-elliott
Copy link
Member

Saving this for after we cut 1.2. Will review then. 👍

Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

Looks good to me, it works as expected :)

Without compression:

➜ curl -sv -o /dev/null localhost:3200/api/traces/05c8ce18fbc11e8264df92bd7d07f5e6  -w '%{size_download}'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3200 (#0)
> GET /api/traces/05c8ce18fbc11e8264df92bd7d07f5e6 HTTP/1.1
> Host: localhost:3200
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Vary: Accept-Encoding
< Date: Wed, 27 Oct 2021 16:05:11 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
<
{ [43159 bytes data]
* Connection #0 to host localhost left intact
* Closing connection 0
43138

With compression:

➜ curl --compressed -sv -o /dev/null localhost:3200/api/traces/05c8ce18fbc11e8264df92bd7d07f5e6  -w '%{size_download}'
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3200 (#0)
> GET /api/traces/05c8ce18fbc11e8264df92bd7d07f5e6 HTTP/1.1
> Host: localhost:3200
> User-Agent: curl/7.64.1
> Accept: */*
> Accept-Encoding: deflate, gzip
>
< HTTP/1.1 200 OK
< Content-Encoding: gzip
< Content-Type: text/plain; charset=utf-8
< Vary: Accept-Encoding
< Date: Wed, 27 Oct 2021 16:05:18 GMT
< Transfer-Encoding: chunked
<
{ [7220 bytes data]
* Connection #0 to host localhost left intact
* Closing connection 0
7187

integration/e2e/compression_test.go Outdated Show resolved Hide resolved
@joe-elliott joe-elliott added this to the v1.3 milestone Oct 28, 2021
@kvrhdn kvrhdn mentioned this pull request Oct 29, 2021
3 tasks
Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Already tested this earlier.

Could you also take a look at my earlier comment? I think we can avoid adding (*client).QueryTraceWithResponse.

CHANGELOG.md Outdated Show resolved Hide resolved
@zalegrala
Copy link
Contributor Author

I've pulled in the changes from main. Let me know if anything else here needs to be addressed.

Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 We just have to fix the changelog entry.

CHANGELOG.md Outdated Show resolved Hide resolved
@kvrhdn
Copy link
Member

kvrhdn commented Nov 9, 2021

CI is really upset with your latest changes, any idea what you did wrong here? 🤣
I can run make test-all successfully locally...

@zalegrala
Copy link
Contributor Author

Oh my our ci is not happy.

@zalegrala
Copy link
Contributor Author

I've rebased on main again.

@kvrhdn
Copy link
Member

kvrhdn commented Nov 9, 2021

Thanks 👍

@kvrhdn kvrhdn merged commit 62af86a into grafana:main Nov 9, 2021
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.

4 participants