openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

Custom HTTP probes create too much noise in logging #130

Closed alexellis closed 2 years ago

alexellis commented 2 years ago

Custom HTTP probes create too much noise in logging

Expected Behaviour

A custom HTTP probe to /healthz shouldn't fill the logs with repetitive messages

Current Behaviour

An OpenFaaS Pro customer reported getting spam in their logs every 1-2 seconds when the kubelet ran its healthcheck.

Possible Solution

Only log when a user-agent does not have a prefix of "kube-probe"

Steps to Reproduce (for bugs)

  1. go build && fprocess=cat mode=http upstream_url=http://192.168.0.15:8080 ./of-watchdog
  2. curl -i localhost:8080/healthz --user-agent "kube-probe/1.21"
  3. 2022/02/20 10:42:18 GET /healthz - 200 OK - ContentLength: 0

Context

Affecting a customer's logging aggregation tool and ability to debug/monitor functions effectively.