Opteo / google-ads-api

Google Ads API client library for Node.js
https://opteo.com
MIT License
264 stars 88 forks source link

Accessing raw request/response data for Google support debugging #314

Open rosslavery opened 3 years ago

rosslavery commented 3 years ago

Hi all,

Trying to debug an issue with Google support and they are requesting the raw request/response logs, not just the request_id.

In earlier versions of the library we used to be able to specify LogOptions which would be passed through to google-ads-node and would let you control verbosity, etc.

In the latest library version, the hooks don't provide as much detail, at least not at the level Google support requires to assist. Are there any alternatives I'm not aware of? If not consider this a feature request to add the LogOptions back :D

wcoots commented 3 years ago

Hi @rosslavery, this is an interesting idea! I will see if we can get it into a future version.

stephanembl commented 2 years ago

Hi, I second this, it would be very helpful!

With partial_failure set to true, I'm not even getting back the request_id. Setting it to false is not an option unfortunately. Any workaround you could think of to allow me to get the request_id back? Thanks!

rosslavery commented 2 years ago

Couple of notes:

stephanembl commented 2 years ago
  • A workaround I've found for this is to replicate the problematic request via the REST API and that tends to get them to be more open to providing support since it's an officially supported method

Great suggestion, I'm going to try this workaround! Thank you @rosslavery

zahnrodolfo commented 1 year ago

Any update on this topic @wcoots ? I am also in need of the same information.

htdangkhoa commented 10 months ago

hi @wcoots, I wrote a Google Ads API library for node, and I supported Logging, you can refer to my source code for your project. https://github.com/htdangkhoa/google-ads/blob/main/src/lib/LoggingInterceptor.ts

After you have defined your Logging Interceptor, you can add it by this way in your service.ts file:

...

// Initialising services can take a few ms, so we cache when possible.
const creds = this.getCredentials();
const client = new protoService({
  sslCreds: creds,
  grpc: new grpc.Client(protoService.apiEndpoint, creds, {
    interceptors: [
      // add logging interceptor to grpc client
    ],
  }),
});

...

Good luck 😃