feat(aggregate): make error HTTP status threshold configurable via APP_MIN_ERROR_CODE#151
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Previously
status >= 500was hardcoded in two places inAggregateCommand:ipm_status_detailscollection query (the "Error pages" view in the UI)This PR makes the threshold configurable via
APP_MIN_ERROR_CODE(default:500), using the sameenvInt/AggregateConfigpattern already established for other thresholds (APP_LOGGING_LONG_REQUEST_TIME_GLOBAL, etc.).Set
APP_MIN_ERROR_CODE=302to track redirects,APP_MIN_ERROR_CODE=400for all client and server errors, or leave at500for the existing behaviour.Changes
AggregateConfig: addpublic int $minErrorCodeAggregateCommand: addDEFAULT_MIN_ERROR_CODE = 500constant, wireAPP_MIN_ERROR_CODEinbuildConfig(), replace both hardcoded500with$this->config->minErrorCode.env: documentAPP_MIN_ERROR_CODE=500alongside other aggregate settingsTest plan
APP_MIN_ERROR_CODE=500produces the same SQL as beforeAPP_MIN_ERROR_CODE=400captures 4xx errors in the Error pages viewCloses #113