-
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(dns): expose
/status/dns
to the status API too (13466)
The dns statistics API should be added into status_listen port, otherwise we'll not get the DNS statistics from admin_listen port in DP. https://konghq.atlassian.net/browse/KAG-5115
- Loading branch information
Showing
5 changed files
with
94 additions
and
8 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
message: > | ||
Starting from this version, a new DNS client library has been implemented and added into Kong. The new DNS client library has the following changes | ||
- Introduced global caching for DNS records across workers, significantly reducing the query load on DNS servers. | ||
- Introduced observable statistics for the new DNS client, and a new Admin API `/status/dns` to retrieve them. | ||
- Introduced observable statistics for the new DNS client, and a new Status API `/status/dns` to retrieve them. | ||
- Simplified the logic and make it more standardized | ||
type: feature | ||
scope: Core |
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
local kong = kong | ||
|
||
|
||
return { | ||
["/status/dns"] = { | ||
GET = function (self, db, helpers) | ||
|
||
if kong.configuration.legacy_dns_client then | ||
return kong.response.exit(501, { | ||
message = "not implemented with the legacy DNS client" | ||
}) | ||
end | ||
|
||
return kong.response.exit(200, { | ||
worker = { | ||
id = ngx.worker.id() or -1, | ||
count = ngx.worker.count(), | ||
}, | ||
stats = kong.dns.stats(), | ||
}) | ||
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
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
9d8933d
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.
Bazel Build
Docker image available
kong/kong:9d8933d849e24d92037c623d07a0793dbaac3c5d
Artifacts available https://github.com/Kong/kong/actions/runs/10312939147