Skip to content

Monitoring for EnvHttpProxyAgent #4619

@SuperOleg39

Description

@SuperOleg39

This would solve...

Hello!

When integrating HTTP proxy for http.request, we often encountered debugging difficulties, the main one being how to understand which requests are going through a proxy?

Before undici, we added logs and metrics in monkeypatched https.Agent.prototype.createConnection method, example.

With EnvHttpProxyAgent, I can't find an obvious mechanism to monitor the operation of the underhood ProxyAgent and its connect method.

The implementation should look like...

So the question is how to intercept proxied requests, and possible solutions that I can suggest:

  • additional meta information about proxy in client.beforeConnect / client.connect / 'request:create' channels payload
  • new diagnostic channel for proxy connection
  • additional meta information about proxy maybe in DispatchOptions, which will allow this information to be collected in a custom interceptor

If you already have a solution, I would be very grateful for the recipe!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions