Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conditionally enable profiler based on a host pattern. #22484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conditionally enable profiler based on a host pattern. #22484

wants to merge 1 commit into from

Conversation

dbrumann
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets ---
License MIT
Doc PR ---

This PR extends conditionally enabling the profiler via the request matcher using a host name or pattern.

@fabpot
Copy link
Member

fabpot commented Sep 3, 2017

Can you explain the use case for that change?

The matcher configuration was added at a time where we thought that having the profiler in production could make sense (and so being able to enable it conditionally made sense). That's not the case anymore. Nobody should ever enable it in production.

With that in mind, I would go in the other direction and remove the matcher config altogether for Symfony 4.0 (deprecating it in 3.4 first of course).

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbrumann
Copy link
Contributor Author

dbrumann commented Sep 4, 2017

We use it on a system where we have multiple (manual) test- and qa-applications on one machine. Both qa- and test-systems work with the same settings only the test systems have the profiler enabled to make it easier for manual testers to get to error logs and enable feature toggles that we added to the profiler bar. On the qa-hosts the profiler should not run, but only on the test-hosts. The easiest way to separate them is by host-name. Otherwise we would have to create a more complex build matrix which we wanted to avoid.

@javiereguiluz
Copy link
Member

@dbrumann a quick idea: maybe you could execute something like echo "\n\nframework:\nprofiler:\nenabled: true" >> app/config/config.yml in some build script to fully enable the profiler only in some hosts ... or maybe you can use an ExpressionLanguage expression to enable it conditionally?

@dbrumann
Copy link
Contributor Author

dbrumann commented Sep 4, 2017

There are definitely other ways around it. Right now we are using a customer MatcherListener that basically does what I did in this PR, so I'm good for now. I just figured since other parts are configurable, this should be too. I'm not sure if agree about removing the matcher configuration altogether as I often use it in "pseudo-prod" instances.

@nicolas-grekas
Copy link
Member

With per-host env vars, you should be able to achieve the same, isn't it?

fabpot added a commit that referenced this pull request Sep 11, 2017
This PR was squashed before being merged into the 3.4 branch (closes #24158).

Discussion
----------

deprecated profiler.matcher configuration

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | closes #24077, would also close #21944, #22484
| License       | MIT
| Doc PR        | not yet

The profiler matcher configuration was added at a time where we thought that having the profiler in production could make sense (and so being able to enable it conditionally made sense). That's not the case anymore. Nobody should ever enable it in production.

With that in mind, I propose to deprecate this setting in 3.4 and remove it in 4.0.

Commits
-------

6eff3e5 deprecated profiler.matcher configuration
2c62ba8 fixed CS
@fabpot fabpot closed this Sep 11, 2017
@dbrumann dbrumann deleted the enable_host_based_profiler_matching branch September 25, 2017 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.