Skip to content

Commit

Permalink
fix: mostly_healthy is considered as healthy (#10639)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0rt authored Dec 21, 2023
1 parent 0a85ba4 commit b9d2dbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apisix/control/v1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ local HTML_TEMPLATE = [[
{% for _, stat in ipairs(stats) do %}
{% for _, node in ipairs(stat.nodes) do %}
{% i = i + 1 %}
{% if node.status == "healthy" then %}
{% if node.status == "healthy" or node.status == "mostly_healthy" then %}
<tr>
{% else %}
<tr bgcolor="#FF0000">
Expand Down
6 changes: 4 additions & 2 deletions apisix/plugins/prometheus/exporter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,10 @@ local function collect(ctx, stream_only)
local stats = control.get_health_checkers()
for _, stat in ipairs(stats) do
for _, node in ipairs(stat.nodes) do
metrics.upstream_status:set((node.status == "healthy") and 1 or 0,
gen_arr(stat.name, node.ip, node.port))
metrics.upstream_status:set(
(node.status == "healthy" or node.status == "mostly_healthy") and 1 or 0,
gen_arr(stat.name, node.ip, node.port)
)
end
end

Expand Down

0 comments on commit b9d2dbf

Please sign in to comment.