install static method
Sets HttpOverrides.global to a new TrackedHttpOverrides, chaining any existing global / zone overrides so prior behaviour is preserved.
Called automatically by VuTelemetry.initialize when InstrumentationsConfig.http is true. Apps with certificate pinning should install their override before init so it becomes previous.
Pass connectionFactory when a prior HttpOverrides installs its own
(custom pooling, proxying, mTLS) so it is composed rather than replaced.
Implementation
static TrackedHttpOverrides install({
HttpConnectionFactory? connectionFactory,
}) {
final existing = HttpOverrides.current;
// Avoid double-wrapping if install is called more than once.
final prior =
existing is TrackedHttpOverrides ? existing.previous : existing;
final overrides = TrackedHttpOverrides(
previous: prior,
connectionFactory: connectionFactory,
);
HttpOverrides.global = overrides;
_log.info(
'Installed TrackedHttpOverrides '
'(chainedExisting=${prior != null}, '
'composedConnectionFactory=${connectionFactory != null}).',
);
return overrides;
}