[Forwardport] AD-HOC feat (Profiler): Allow supplying complex profiler configuration #17528
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.
Original Pull Request
#15171
Description
Magento 2 provides a primitive creating profiles of the application,
similar to those esposed by the transaction tracing community. These
allow getting a granular view of the application based on a custom set
of metrics, rather than relying on PHP callgraph profilers to determine
how an application is behaving.
It is currently possible to modify the output of a transaction trace.
However, it is not currently possible to modify the transaction trace
driver. This commit seeks to extend the configuration such that the
driver itself can be replaced, rather than simply the output.
This allows replacing the driver entirely with something like the
OpenTracing API, which can then use its own exporters to express the
code to something like the CNCF Jaeger project.
This, in turn, allows getting a granular view of the transactions in an
application.
== Design Notes ==
=== Minimal changes ===
Considerable additional work is bring prototyped with the alpha
OpenCensus APIs, however at this time this is inappropriate to be merged
into the core. The APIs are immature, and the approach for reading
transaction traces not finalised.
This allows continued experimentation up to and including deployment to
production infrastructure without committing early to supporting this
model of profiling.
=== Variables prefixed with "profiler" ===
At first glace, the variables appear to be unnecessarily verbose.
However, they are declared in the global context, and are thus
namespaced to avoid collisions.
Contribution checklist