Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

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

Merged
merged 1 commit into from
Dec 14, 2018

Conversation

hbagdi
Copy link
Member

@hbagdi 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 December 14, 2018 04:53
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 Compare December 14, 2018 16:51
@hbagdi hbagdi merged commit 3e4c63d into next Dec 14, 2018
@hbagdi hbagdi deleted the fix/avoid-sending-status-code branch December 14, 2018 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants