Skip to content

Frontend health endpoint logs excessive noise in Kubernetes #7080

@inpyolee-datarize

Description

@inpyolee-datarize

Problem

The frontend health endpoint (/health) in frontend/api/index.js contains a hardcoded console.log('Healthcheck complete') on every request:

app.get('/health', (req, res) => {
  console.log('Healthcheck complete')
  res.send('OK')
})

In Kubernetes, liveness and readiness probes hit /health every 10 seconds per pod. This generates a constant stream of Healthcheck complete log lines that:

  • Increases log storage/ingestion costs (e.g. CloudWatch, Datadog, Loki) — especially when running multiple replicas
  • Drowns out meaningful application logs, making it harder to debug real issues
  • Cannot be disabled via environment variables — ACCESS_LOG_LOCATION does not affect this since it's a direct console.log call

Expected Behavior

Health check requests should not produce log output by default, or there should be an environment variable (e.g. LOG_HEALTHCHECK=false) to suppress it.

Suggested Fix

Remove the console.log from the health endpoint, or gate it behind an environment variable:

app.get('/health', (req, res) => {
  if (process.env.LOG_HEALTHCHECK === 'true') {
    console.log('Healthcheck complete')
  }
  res.send('OK')
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions