Skip to content

feat(aggregate): make error HTTP status threshold configurable via APP_MIN_ERROR_CODE#151

Merged
XOlegator merged 3 commits into
masterfrom
feat/configurable-min-error-code
May 27, 2026
Merged

feat(aggregate): make error HTTP status threshold configurable via APP_MIN_ERROR_CODE#151
XOlegator merged 3 commits into
masterfrom
feat/configurable-min-error-code

Conversation

@XOlegator
Copy link
Copy Markdown
Contributor

Summary

Previously status >= 500 was hardcoded in two places in AggregateCommand:

  • the notification query (error pages email)
  • the ipm_status_details collection query (the "Error pages" view in the UI)

This PR makes the threshold configurable via APP_MIN_ERROR_CODE (default: 500), using the same envInt / AggregateConfig pattern already established for other thresholds (APP_LOGGING_LONG_REQUEST_TIME_GLOBAL, etc.).

Set APP_MIN_ERROR_CODE=302 to track redirects, APP_MIN_ERROR_CODE=400 for all client and server errors, or leave at 500 for the existing behaviour.

Changes

  • AggregateConfig: add public int $minErrorCode
  • AggregateCommand: add DEFAULT_MIN_ERROR_CODE = 500 constant, wire APP_MIN_ERROR_CODE in buildConfig(), replace both hardcoded 500 with $this->config->minErrorCode
  • .env: document APP_MIN_ERROR_CODE=500 alongside other aggregate settings

Test plan

  • CI passes
  • Default behaviour unchanged: APP_MIN_ERROR_CODE=500 produces the same SQL as before
  • Setting APP_MIN_ERROR_CODE=400 captures 4xx errors in the Error pages view

Closes #113

XOlegator added 3 commits May 27, 2026 22:25
…P_MIN_ERROR_CODE

Previously hardcoded to 500 in two SQL queries (notification and ipm_status_details
collection). Now reads APP_MIN_ERROR_CODE from the environment (default: 500),
matching the existing envInt/AggregateConfig pattern used for other thresholds.

Closes #113
@XOlegator XOlegator merged commit 9b2073c into master May 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant