1
votes

I have an application that uses Google Cloud Translation API for translating contents from a source language to the languages used by the different users.

Since there are several clients for the API, I would like to distinguish the request numbers for different clients, like making a distinction between Android and iOS clients.

There's a dashboard in Google Cloud Translation API Overview page that contains the Traffic chart with a By credential option, which should be able to distinguish the request numbers by their credentials (in our case, API keys.) Unfortunately, it doesn't, the only option available there being Unspecified.

Moreover, even if I change the filter of credentials to No selection, the Traffic map is still the same!

google cloud translation api dashboard

I have also attached the project's credential list, where only API keys are used.

enter image description here

enter image description here

Please help me how to know the request numbers by different API keys, thanks.

Update:

Here are how I send requests to Google Cloud Translation API.

I tried with Postman and Swift code in iOS (what I actually do in my project.) Sent GET/POST requests to the API with API keys and POST requests with service account token, but neither API keys nor service account shown in request logs as the first picture.

Postman

Request with API key in GET enter image description here

Request with API key in POST enter image description here

Request with service account token in POST enter image description here

Swift code

Code enter image description here

Response
enter image description here

1
what do you see when you open "Google Cloud Translation API" -> "Credentials"? - Caner
Hi @Caner I attached pictures of credentials, can you help to take a look? Thanks. - Charlie Hung
Could you please provide an example on how a request to your API is performed using these keys? - Rodrigo C.
@RodrigoC. I updated how I sent requests to API, please take a look. - Charlie Hung

1 Answers

1
votes

I have also done some requests to Translation API using different credentials. After doing the requests, I have checked my dashboard and I encountered the same situation as you, with all requests marked as Unspecified when choosing the By credential option.

As it turns out, there is an issue related to this situation, as this is not the expected behavior. This has been notified and it will be sorted out by the Google team. You can keep track on any updates related to this issue here. If you click the star button on this site, you will get email notifications whenever any progress has been made. Please bear in mind that it may take some time for this issue to be resolved.

In the meantime, you may consider tracking the client information through the statistics of the applications that make requests to the API, if possible. Thanks for your help on finding this issue.