Skip to content

health_check: include HTTP status code in health check events#44390

Open
k1chik wants to merge 3 commits intoenvoyproxy:mainfrom
k1chik:fix/40221-health-check-status-code
Open

health_check: include HTTP status code in health check events#44390
k1chik wants to merge 3 commits intoenvoyproxy:mainfrom
k1chik:fix/40221-health-check-status-code

Conversation

@k1chik
Copy link
Copy Markdown

@k1chik k1chik commented Apr 10, 2026

Commit Message:
health_check: include HTTP status code in health check events

Additional Description:
Add http_status_code field to HealthCheckEjectUnhealthy and HealthCheckFailure proto messages. When the HTTP health checker receives a non-2xx response, the status code is threaded through handleFailure() and setUnhealthy() into the event logger and populated on the proto. Non-HTTP health checkers (TCP, gRPC, Redis,
Thrift) pass 0, which the logger skips — the field is omitted from the event for non-HTTP failures.

This fix was developed with assistance from Claude Code. I fully understand all submitted code and take ownership of this PR.

Risk Level: Low

Testing:

  • bazel test //test/common/upstream:health_checker_impl_test --config=clang -c fastbuild
  • bazel test //test/extensions/health_checkers/redis:redis_test --config=clang -c fastbuild
  • bazel test //test/extensions/health_checkers/thrift:thrift_test --config=clang -c fastbuild

Docs Changes: N/A

Release Notes: Added under new_features in changelogs/current.yaml.

Platform Specific Features: N/A

Fixes #40221

k1chik added 3 commits April 7, 2026 14:28
Add http_status_code field to HealthCheckEjectUnhealthy and
HealthCheckFailure proto messages. When the HTTP health checker
receives a non-2xx response, the status code is threaded through
handleFailure() and setUnhealthy() into the event logger and
populated on the proto. Non-HTTP health checkers (TCP, gRPC, Redis,
Thrift) pass the default value of 0, which the logger skips.

Fixes envoyproxy#40221

Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
…eck-status-code

Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>

# Conflicts:
#	changelogs/current.yaml
#	source/extensions/health_checkers/http/health_checker_impl.cc
…eck-status-code

Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
@repokitteh-read-only
Copy link
Copy Markdown

Hi @k1chik, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #44390 was opened by k1chik.

see: more, trace.

@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @adisuissa
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #44390 was opened by k1chik.

see: more, trace.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve health status logging on envoy

2 participants