You've already forked wp-prometheus
fix: Resolve memory exhaustion with Twig-based plugins (v0.4.1)
All checks were successful
Create Release Package / build-release (push) Successful in 57s
All checks were successful
Create Release Package / build-release (push) Successful in 57s
- Add early metrics endpoint handler to intercept /metrics before full WP init - Remove content filters during metrics collection to prevent recursion - Skip extensibility hooks in early metrics mode - Change template_redirect to parse_request for earlier interception Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -121,9 +121,14 @@ class Collector {
|
||||
/**
|
||||
* Fires after default metrics are collected.
|
||||
*
|
||||
* Skip in early metrics mode to avoid triggering third-party hooks
|
||||
* that may cause recursion issues (e.g., Twig-based plugins).
|
||||
*
|
||||
* @param Collector $collector The metrics collector instance.
|
||||
*/
|
||||
do_action( 'wp_prometheus_collect_metrics', $this );
|
||||
if ( ! defined( 'WP_PROMETHEUS_EARLY_METRICS' ) || ! WP_PROMETHEUS_EARLY_METRICS ) {
|
||||
do_action( 'wp_prometheus_collect_metrics', $this );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user