question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google Play Developer Reporting API . vitals . errors . counts

See original GitHub issue

Environment details

  • OS type and version:
  • Python version: 3.6.8
  • pip version: 21.2.3
  • google-api-python-client version: 2.44.0

Code example

body = {
   "metrics": ["distinctUsers"],
   "timelineSpec":{
           "aggregationPeriod": "DAILY",
           "startTime": {
                   'timeZone': {'id': 'America/Los_Angeles'},
                   'year': 2022,
                   'month': 4,
                   'day': 4
           },
           "endTime": {
                   'timeZone': {'id': 'America/Los_Angeles'},
                   'year': 2022,
                   'month': 4,
                   'day': 11
           }
   }
}
count_msg = sqladmin.vitals().errors().counts().query(
        name="apps/{com.example.app}/errorCountMetricSet",
        body=body
).execute()

Stack trace

googleapiclient.errors.HttpError: <HttpError 400 when requesting https://playdeveloperreporting.googleapis.com/v1alpha1/apps/com.kwai.video/errorCountMetricSet:query?alt=json returned "The requested metrics, dimensions and aggregation_period cannot be used together.". Details: "The requested metrics, dimensions and aggregation_period cannot be used together.">

I have completely referred to the corresponding API documents to fill in https://googleapis.github.io/google-api-python-client/docs/dyn/playdeveloperreporting_v1alpha1.vitals.errors.counts.html#query My question is:

Are there any errors in my parameters and how to correct them

Thanks!

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
galbgonzcommented, Apr 26, 2022

Hi @newFunL, thanks for the bug report. The queries to errorCountMetricSet must specify the “errorType” dimension in the request, it is a required dimension. I have looked at the API docs and we missed documenting this. Sorry! I will get the API docs fixed asap.

0reactions
galbgonzcommented, Dec 2, 2022

Hi @trinath89,

thanks for the details. I have confirmed that the scope is actually still needed to generate a bearer token even when using service accounts.

The way to use a service account is roughly as follows:

  1. Create a GCP consumer project and get an API key for it
  2. Link your GCP consumer project to the Play Console developer account in the API access UI
  3. Create a service account (https://cloud.google.com/iam/docs/service-accounts), and download the account’s key file (the equivalent of its password)
  4. “Invite” that service account to be a user of your Play Console developer, and grant at least “read only” access to some or all apps.
  5. Exchange the service account key for an OAuth token using a tool such as oauth2l.

I assume you have done (1), and (2) since you were able to fetch reviews. If in step 3 you downloaded the key into a file named key.json, you can then use this command to get a bearer token:

$ oauth2l fetch --json ~/key.json --scope playdeveloperreporting

As I said the API OAuth scope currently is only enabled to work with service accounts. We’re planning to allow person OAuth tokens too but the timeline is unclear at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method: vitals.errors.counts.get | Play Developer Reporting API
Method: vitals.errors.counts.get · HTTP request · Path parameters · Request body · Response body · Authorization Scopes.
Read more >
Android vitals - Android Developers
Android vitals only counts issues if they are reported on certified devices, and on apps that were installed from Google Play. Other data ......
Read more >
Android vitals | Google Play Console
Monitor and improve the technical quality of your app or game. Android vitals reports on key user-impacting issues and helps you to debug...
Read more >
Monitor your app's technical quality with Android vitals
Data types and metrics ... Android vitals data is available for the previous 90 days in Play Console, and for three years in...
Read more >
playdeveloperreporting - Go Packages
... provides access to the Google Play Developer Reporting API. ... sets:** * vitals.errors contains unnormalized version (absolute counts) of crashes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found