-
Notifications
You must be signed in to change notification settings - Fork 79
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 support #223
Add gzip support #223
Conversation
README.md
Outdated
@@ -63,6 +63,7 @@ More configuration parameters: | |||
- `port`: listen port (default: 24231) | |||
- `metrics_path`: metrics HTTP endpoint (default: /metrics) | |||
- `aggregated_metrics_path`: metrics HTTP endpoint (default: /aggregated_metrics) | |||
- `content_encoding`: encoding format for the exposed metrics (default: identity) |
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.
usually you'd read Accept-Encoding
header from the request to determine how to encode the response
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
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.
This is true
But in our case Prometheus server accepts both gzip and identity (it's not specific) so the request header has both in accept encoding. We cannot determine whether we only need compressed or identity. That's why I configured it in server side
amazing turnaround, much appreciated for your efforts @Athishpranav2003! |
Thanks @Lusitaniae |
Looks like you just need to follow these steps:
https://github.com/fluent/fluent-plugin-prometheus/pull/223/checks?check_run_id=28060535686 |
@ashie can you please check this |
@Athishpranav2003 Thanks for your contribution!
|
Signed-off-by: Athishpranav2003 <[email protected]>
Signed-off-by: Athishpranav2003 <[email protected]>
@ashie I have made the changes. In addition i have added zlib as dependency to avoid break incase some system misses it(highly unlikely). |
I'll fix CI for Ruby 2.7 in another pull request, so please leave it. |
@ashie do you need help in testing this locally before merging |
It looks good, I'll merge this soon after checking if we missed anything in relation to the surrounding code. |
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.
I have made some comments about some things I would like to see fixed.
In addition, it would be better to add unit tests for this feature if possible.
Ok Regarding UTs there is no UTs written for the plugin. |
Signed-off-by: Athishpranav2003 <[email protected]>
@ashie i have addressed your comments and also refactored some small part of my code |
Signed-off-by: Athishpranav2003 <[email protected]>
@ashie i have added UTs now |
Signed-off-by: Athishpranav2003 <[email protected]>
@ashie addressed the comments |
Signed-off-by: Athishpranav2003 <[email protected]>
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
I've removed wrongly added fluent-plugin-prometheus-2.1.0.gem in your commit. |
Thanks! |
Added support for gzip compression while exposing metrics.
Tested locally with prometheus server
#219