fix: make profiler configurable and disable it by default in non-debug mode#1243
Open
martiis wants to merge 1 commit intooverblog:masterfrom
Open
fix: make profiler configurable and disable it by default in non-debug mode#1243martiis wants to merge 1 commit intooverblog:masterfrom
martiis wants to merge 1 commit intooverblog:masterfrom
Conversation
Nyholm
reviewed
Apr 10, 2026
…g mode The profiler.yaml was loaded unconditionally, causing GraphQLCollector's event listener to run on every GraphQL request in production — parsing queries and deep-cloning results for data that was never consumed. Add an `enabled` option to the `profiler` configuration section, defaulting to `kernel.debug`. This allows explicit control while ensuring profiler services are only registered in dev/test by default.
07076ed to
dbca7b1
Compare
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
The profiler.yaml configuration was loaded unconditionally in OverblogGraphQLExtension::loadConfigFiles(), registering GraphQLCollector and ProfilerController in all environments — including production.
While the data_collector tag is harmless when the profiler is disabled (Symfony's ProfilerPass simply skips it), the kernel.event_listener tag on graphql.post_executor is processed by RegisterListenersPass independently.
This means GraphQLCollector::onPostExecutor() fired on every GraphQL request in production, performing:
All this data was accumulated into $this->batches and never consumed, since collect() is only called by Symfony when the profiler is enabled.
Impact