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

fix: skip sending status code after body is sent #33

Merged
merged 1 commit into from Dec 14, 2018

Conversation

Projects
None yet
2 participants
@hbagdi
Copy link
Member

hbagdi commented Dec 14, 2018

This commit fixes a bug where the plugin tries to send HTTP status code
after the response body is sent for /metrics endpoint.

This resulted in error logs in Kong.
A test has been added to ensure that no error logs are generated when
/metrics is scraped by Prometheus.

Another test has been added to ensure that the response body only
contains either metrics or comments describing the metrics.
This test is added to catch regression for
Kong/kong#4077, where Kong injected HTML
generated by the default Lapis handler.

Fixes #32

@hbagdi hbagdi requested a review from hishamhm Dec 14, 2018

fix: skip sending status code after body is sent
This commit fixes a bug where the plugin tries to send HTTP status code
after the response body is sent for `/metrics` endpoint.

This resulted in error logs in Kong.
A test has been added to ensure that no error logs are generated when
`/metrics` is scraped by Prometheus.

Another test has been added to ensure that the response body only
contains either metrics or comments describing the metrics.
This test is added to catch regression for
Kong/kong#4077, where Kong injected HTML
generated by the default Lapis handler.

Fixes #32

@hbagdi hbagdi force-pushed the fix/avoid-sending-status-code branch from c3d304d to ab5e1a0 Dec 14, 2018

@hbagdi hbagdi merged commit 3e4c63d into next Dec 14, 2018

@hbagdi hbagdi deleted the fix/avoid-sending-status-code branch Dec 14, 2018

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