apify-sdk-js icon indicating copy to clipboard operation
apify-sdk-js copied to clipboard

Add SDK version to Client user agent

Open mnmkng opened this issue 1 year ago • 2 comments

Feature

It would be great if we could add information about SDK to Apify Client calls that are being called with Apify SDK and not Client directly.

Motivation

We would like to understand which Actor runs on the platform are triggered from Client (external calls) or SDK (implies either some Actor implementation, or perhaps a wrong selection of library). The user agents are already tracked on platform, so no changes needed there.

Ideal solution or implementation, and any additional constraints

The best way to do that would probably be by adding SDK version to the Client user agent.

Alternative solutions or implementations

No response

Other context

If this is accepted, it might be worth adding even more info, like Crawlee version, if called from Crawlee.

mnmkng avatar Oct 14 '24 11:10 mnmkng

Sounds good (and simple enough), I guess the first step is allowing to append to the UA from inside the client.

Better to do this sooner than later, right?

B4nan avatar Oct 14 '24 13:10 B4nan

It's not super high prio TBH. But it would be nice if it didn't just die somewhere in icebox 😄

mnmkng avatar Oct 15 '24 10:10 mnmkng

So it actually looks like the axios upgrade I did some time ago broke the custom UA completely, we didn't have any tests for this. It only works when I disable the request interceptors.

edit: false alert, the test had custom interceptor that removes all the headers

B4nan avatar Oct 31 '24 13:10 B4nan