Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@Karolis2011

Description

@Karolis2011

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions