ory/hydra

Disable admin health check request logging environment setting ignored

benmurden opened this issue · 1 comments

Preflight checklist

Ory Network Project

No response

Describe the bug

Following the configuration reference, we are setting environment variables SERVE_PUBLIC_REQUEST_LOG_DISABLE_FOR_HEALTH and SERVE_ADMIN_REQUEST_LOG_DISABLE_FOR_HEALTH to "true" as in the following Terraform snippet.

    {
      name  = "SERVE_ADMIN_REQUEST_LOG_DISABLE_FOR_HEALTH"
      value = "true"
    },

However, we still see logs for the health check endpoint (/health/ready) on the admin port only (4445). The setting appears to work correctly for the public endpoint.

Reproducing the bug

Run docker container with environment variables set.

e.g.

$ docker run -it --rm -p 4445:4445 -p 4444:4444 --env SERVE_ADMIN_REQUEST_LOG_DISABLE_FOR_HEALTH="true" [...] oryd/hydra:v2.1.1

Request with curl.

$ curl http://localhost:4445/health/ready
{"status":"ok"}

Relevant log output

INFO[2023-09-15T01:51:17Z] started handling request                      http_request=map[headers:map[accept:*/* user-agent:curl/7.68.0] host:localhost:4445 method:GET path:/health/ready query:<nil> remote:172.17.0.1:53398 scheme:http]
INFO[2023-09-15T01:51:17Z] completed handling request                    http_request=map[headers:map[accept:*/* user-agent:curl/7.68.0] host:localhost:4445 method:GET path:/health/ready query:<nil> remote:172.17.0.1:53398 scheme:http] http_response=map[headers:map[content-type:application/json; charset=utf-8] size:16 status:200 text_status:OK took:2.773718ms]

Relevant configuration

No response

Version

v2.1.1

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker

Additional Context

No response

mig5 commented

Seems to be ok on Hydra 2.2.0 (I get no logs on either public or admin port for the health checks)