Skip to content

Healthcheck filter fails when disabling server metrics #8630

Closed

Description

@ivanpondal

Given an Envoy v1.11.1 node with server metrics excluded via StatsMatcher and HTTP health checking filter enabled, when hitting the healthcheck endpoint a 503 response is received independently of the true node health.

From my research this seems to be due to the healthcheck depending directly on the server metrics:

Minimal config to reproduce issue

admin:
  access_log_path: /tmp/admin_access.log
  address:
    socket_address: { address: 0.0.0.0, port_value: 9901 }
stats_config:
  stats_matcher:
    reject_all: true
static_resources:
  listeners:
  - name: proxy
    address:
      socket_address: { address: 0.0.0.0, port_value: 10000 }
    filter_chains:
    - filters:
      - name: envoy.http_connection_manager
        config:
          stat_prefix: ingress_http
          route_config:
            name: route
          http_filters:
          - name: envoy.health_check
            config:
              pass_through_mode: false
              headers:
              - name: ":path"
                exact_match: "/healthcheck"
          - name: envoy.router

Healthcheck request

$ curl -i localhost:10000/healthcheck
HTTP/1.1 503 Service Unavailable
x-envoy-upstream-healthchecked-cluster: local-cluster
date: Wed, 16 Oct 2019 17:33:43 GMT
server: envoy
connection: close
content-length: 0

Workaround

The workaround is to whitelist metrics needed by the health-check:

stats_config:
 stats_matcher:
  inclusion_list:
    patterns:
    - suffix: live
    - suffix: membership_healthy
    - suffix: membership_degraded
    - suffix: membership_total

Activity

  1. mattklein123 commented on Oct 16, 2019

    @mattklein123
    Member

    Dup of #8473

  2. venilnoronha commented on Oct 23, 2019

    @venilnoronha
    Member

    This is fixed in #8482.

  3. ivanpondal commented on Oct 25, 2019

    @ivanpondal
    Author

    @venilnoronha I took a look at the PR and noticed it removes the usage of server_stats.live but not the cluster ones (membership_total, membership_degraded and membership_healthy). Couldn't that cause the minimum healthy clusters functionality to work improperly?

  4. stale commented on Nov 24, 2019

    @stale

    This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

  5. added
    stale
    on Nov 24, 2019
  6. stale commented on Dec 1, 2019

    @stale

    This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicatestale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions