-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
How to provide my own http client implementation? #1004
Comments
I found a setHttpClient method but it's deprecated. And it doesn't specify what I should use instead. |
That deprecation was added in #855, where we introduced the |
Yeah I'm trying to do that... I got this far: $options = ['dsn' => '...'];
$client = ClientBuilder::create($options)
->setTransportFactory(
new class implements \Sentry\Transport\TransportFactoryInterface {
public function create(Options $options): TransportInterface
{
return new HttpTransport(
$options,
/* provide http client factory */,
/* provide request factory */,
true,
false
);
}
}
)
->getClient();
SentrySdk::init()->bindClient($client); The current problem I'm trying to solve is finding request factory. This library is using It says I should use This however returns Overall navigating through all of this deprecated stuff is getting very complicated. Especially since this library itself is also relying on deprecated API. From a library that claims to not be tied to any specific Http implementation, providing my own is extremely difficult. |
Unfortunately this lib predates a few of the PSR standards that we should use for that. For example, You do not have to use |
Yeah, I did that... It works in the end... but the entire hack has like 120 lines and I return the event id even on failure because I can't wait for the result (#1005). Also I'm still not sure how to deal with exceptions since |
I'm closing this due to the fact that a lot of time passed, and in the meanwhile the version 3 of the SDK got released. Feel free to open a new issue if the issue persist. |
Hi, I'd like to use this library but since it's not tied into any specific Http library I'd like to provide my own implementation. How can I do that?
I'm not interested in any existing guzzle-based, curl-based or any other adapter. I don't even want to use
php-http/discovery
. I simply want to specify my own implementation which will be based onamphp/http-client
. (As far as I know there is no existing package providing the integration.)So far I was unable to find a way to do that. The documentation only states that the sdk is not tied to any specific implementation but there doesn't seem to be any option to provide my own.
The text was updated successfully, but these errors were encountered: