-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Conditionally enable profiler based on a host pattern. #22484
Conversation
Can you explain the use case for that change? The With that in mind, I would go in the other direction and remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@dbrumann a quick idea: maybe you could execute something like |
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. |
With per-host env vars, you should be able to achieve the same, isn't it? |
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
This PR extends conditionally enabling the profiler via the request matcher using a host name or pattern.