You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's all! The script is automatically imported thanks to [Composer autoloader](https://getcomposer.org/doc/04-schema.md#files).
22
+
23
+
ℹ️ You can also copy the content of [`newrelic_hook.php`](newrelic_hook.php) directly in your project.
24
+
25
+
## Explanations
26
+
27
+
The [newrelic extension](https://github.com/newrelic/newrelic-php-agent)[defines a Php function](https://github.com/newrelic/newrelic-php-agent/blob/3f93ee47f80703d46d8fccd53be7d6b80361a594/agent/lib_guzzle6.c#L433-L461),
28
+
a [Guzzle](https://github.com/guzzle/guzzle) middleware to report some metrics on each requests sent from Php.
29
+
30
+
31
+
Fortunately, the extension defines this function only if it doesn't already exist… then this workaround define this function before newrelic does 😅.
32
+
Original code is copied in this function, but we create a new http requests dedicated to NewRelic reporting, resolving the Http `HOST` header.
33
+
The original request used by Guzzle stays unchanged.
0 commit comments