-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #4077, where Kong injected HTML generated by the default Lapis handler. Fixes #32 From #33
- Loading branch information
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,6 @@ local function collect() | |
end | ||
|
||
prometheus:collect() | ||
return kong.response.exit(200) | ||
end | ||
|
||
|
||
|
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