8000 HTTP Client made using `withOptions` is not tracked in profiler · Issue #44312 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

HTTP Client made using withOptions is not tracked in profiler #44312

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

Closed
Karolis2011 opened this issue Nov 27, 2021 · 1 comment
Closed

HTTP Client made using withOptions is not tracked in profiler #44312

Karolis2011 opened this issue Nov 27, 2021 · 1 comment

Comments

@Karolis2011
Copy link

Symfony version(s) affected

5.3.11

Description

HTTP client created using withOptions isn't properly tracked in profiler.

How to reproduce

  1. Inject HTTPClientInterface to a service or a controller.
  2. Make a new instance of HTTPClientInterface by calling withOptions([]).
  3. Make requests using newly created HTTP Client.
  4. Take note that client logs it's requests under log, but it's requests aren't tracked by HTTP client profiler section.

Possible Solution

I temporally worked around this issue by manually calling registerClient of injected service data_collector.http_client. But said service is not available under production, so my work around had to be removed before deployment.

Other solution is to add a reference to data collector in TraceableHttpClient and in it's withOptions section call register on data collector.

Additional Context

No response

@nicolas-grekas
Copy link
Member

Please give #44671 a try

nicolas-grekas added a commit that referenced this issue Dec 16, 2021
…ptions() (nicolas-grekas)

This PR was merged into the 5.3 branch.

Discussion
----------

[HttpClient] Fix tracing requests made after calling withOptions()

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #44312
| License       | MIT
| Doc PR        | -

Commits
-------

06b25c7 [HttpClient] Fix tracing requests made after calling withOptions()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0