GithubHelp home page GithubHelp logo

Comments (12)

lcc3108 avatar lcc3108 commented on May 25, 2024

You need to attach the debug log.

It is estimated that there is a problem with the following link.
#51 (comment)

from grafana-google-analytics-datasource.

asil-x avatar asil-x commented on May 25, 2024

You need to attach the debug log.

It is estimated that there is a problem with the following link. #51 (comment)

I tried but still same result, here is my log
2023-08-31 10:02:52 logger=context userId=1 orgId=1 uname=admin t=2023-08-31T08:02:52.530606107Z level=error msg="Request Completed" method=GET path=/api/datasources/uid/d4721ac7-2d74-4bad-bf05-3071c2f5a1e5/health status=500 remote_addr=172.17.0.1 time_ms=12930 duration=12.930048263s size=53 referer=http://localhost:3000/connections/datasources/edit/d4721ac7-2d74-4bad-bf05-3071c2f5a1e5 handler=/api/datasources/uid/:uid/health
2023-08-31 10:02:52 logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-08-31T08:02:52.530451579Z level=error msg="plugin process exited" path=/var/lib/grafana/plugins/blackcowmoo-googleanalytics-datasource/gpx_blackcowmoo-googleanalytics-datasource_linux_amd64 pid=54 error="exit status 2"
2023-08-31 10:02:52 logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-08-31T08:02:52.879560581Z level=info msg=Profiler enabled=false

from grafana-google-analytics-datasource.

lcc3108 avatar lcc3108 commented on May 25, 2024

The log you attached is not a "debug" log.
However, it seems to be the same issue as #51.

I'm releasing version 0.2.1 to patch this issue and I'm waiting for your Grafana approval.

from grafana-google-analytics-datasource.

moovs avatar moovs commented on May 25, 2024

@lcc3108 maybe you remember on verion 0.2.0 I gor error Plugin Health Check Failed, after you updated to 0.2.1 version I tried this version and this error gone, but I received a new error:
Screenshot 2023-09-01 at 10 24 02

Whay do you think about it? Is it problem with my profile or something else?

from grafana-google-analytics-datasource.

lcc3108 avatar lcc3108 commented on May 25, 2024

@moovs
Which version of health check did you do, UA(GA3) or GA4?

Please attach a debug log to check the problem.

from grafana-google-analytics-datasource.

moovs avatar moovs commented on May 25, 2024

Yes, it's UA profile here is my debug logs:

logger=accesscontrol.service t=2023-09-01T08:36:25.439017523Z level=debug msg="fetch permissions from store" key=rbac-permissions-1-user-1
logger=accesscontrol.service t=2023-09-01T08:36:25.453395326Z level=debug msg="cache permissions" key=rbac-permissions-1-user-1
logger=accesscontrol.evaluator t=2023-09-01T08:36:25.45366309Z level=debug msg="matched scope" userscope=datasources:* targetscope=datasources:uid:Jbdfjksdf
logger=datasources t=2023-09-01T08:36:25.453886174Z level=debug msg="Received command to update data source" url=
logger=datasource t=2023-09-01T08:36:25.453904195Z level=debug msg="Applying default URL parsing for this data source type" type=blackcowmoo-googleanalytics-datasource url=
logger=datasource t=2023-09-01T08:36:25.453912569Z level=debug msg="Data source URL doesn't specify protocol, so prepending it with http:// in order to make it unambiguous" type=blackcowmoo-googleanalytics-datasource url=
logger=sqlstore.session t=2023-09-01T08:36:25.465154704Z level=debug msg="reusing existing session" transaction=true
logger=sqlstore.session t=2023-09-01T08:36:25.4763378Z level=debug msg="reusing existing session" transaction=true
logger=secrets.kvstore t=2023-09-01T08:36:25.493462945Z level=debug msg="got secret value" orgId=1 type=datasource namespace=" Google Analytics"
logger=sqlstore.session t=2023-09-01T08:36:25.499768181Z level=debug msg="reusing existing session" transaction=true
logger=sqlstore.session t=2023-09-01T08:36:25.50735888Z level=debug msg="reusing existing session" transaction=true
logger=secrets.kvstore t=2023-09-01T08:36:25.507834119Z level=debug msg="secret value updated" orgId=1 type=datasource namespace=" Google Analytics"
logger=sqlstore.transactions t=2023-09-01T08:36:25.50797674Z level=debug msg="skip committing the transaction because it belongs to a session created in the outer scope"
logger=sqlstore.transactions t=2023-09-01T08:36:25.507989836Z level=debug msg="skip committing the transaction because it belongs to a session created in the outer scope"
logger=secrets.kvstore t=2023-09-01T08:36:25.522798376Z level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=" Google Analytics"
logger=accesscontrol.service t=2023-09-01T08:36:25.728561784Z level=debug msg="using cached permissions" key=rbac-permissions-1-user-1
logger=accesscontrol.service t=2023-09-01T08:36:26.324817819Z level=debug msg="using cached permissions" key=rbac-permissions-1-user-1
logger=accesscontrol.evaluator t=2023-09-01T08:36:26.325106851Z level=debug msg="matched scope" userscope=datasources:* targetscope=datasources:uid:JbvB1dkIk
logger=secrets.kvstore t=2023-09-01T08:36:26.336598247Z level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=" Google Analytics"
logger=accesscontrol.service t=2023-09-01T08:36:26.546011835Z level=debug msg="using cached permissions" key=rbac-permissions-1-user-1
logger=datasources t=2023-09-01T08:36:26.546206285Z level=debug msg="Querying for data source via SQL store" uid=Jbljijf orgId=1
logger=secrets.kvstore t=2023-09-01T08:36:26.557896215Z level=debug msg="got secret value from cache" orgId=1 type=datasource namespace=" Google Analytics"
logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-09-01T08:36:26.667933897Z level=debug msg="UA GetAccountSummaries raw accounts" debug="[map[id:225841363 kind:analytics#accountSummary name:Default Account for Firebase]]"
logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-09-01T08:36:26.668014326Z level=debug msg="UA GetAccountSummaries accounts" debug=null
logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-09-01T08:36:26.668042791Z level=error msg="CheckHealth: Not Exist Valid Profile"
logger=context userId=1 orgId=1 uname=superadmin t=2023-09-01T08:36:26.668317754Z level=info msg="Request Completed" method=GET path=/api/datasources/uid/JbvB1dkIk/health status=400 remote_addr=172.25.0.1 time_ms=133 duration=133.068223ms size=67 referer=http://domain/datasources/edit/Jbdfkjk handler=/api/datasources/uid/:uid/health
logger=ngalert.scheduler t=2023-09-01T08:36:30.012143913Z level=debug msg="No changes detected. Skip updating"

from grafana-google-analytics-datasource.

lcc3108 avatar lcc3108 commented on May 25, 2024

@moovs
UA has a structure of account -> webproperty -> profile.
You must have a profile to query the data.

logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-09-01T08:36:26.667933897Z level=debug msg="UA GetAccountSummaries raw accounts" debug="[map[id:225841363 kind:analytics#accountSummary name:Default Account for Firebase]]"
logger=plugin.blackcowmoo-googleanalytics-datasource t=2023-09-01T08:36:26.668014326Z level=debug msg="UA GetAccountSummaries accounts" debug=null

According to the log, only one account without webproperty and profile(items[0])
The error message "Not Exist Valid Profile" was responded accordingly.

Based on the past post (#51 (comment)), all accounts are as follows.

{
  "kind": "analytics#accountSummaries",
  "username": "****",
  "totalResults": 4,
  "startIndex": 1,
  "itemsPerPage": 10,
  "items": [
    {
      "id": "2*****",
      "kind": "analytics#accountSummary",
      "name": "Default Account for Firebase",
      "webProperties": []
    },
    {
      "id": "2******",
      "kind": "analytics#accountSummary",
      "name": "***",
      "webProperties": []
    },
    {
      "id": "2***",
      "kind": "analytics#accountSummary",
      "webProperties": [
        {
          "kind": "analytics#webPropertySummary",
          "id": "UA-2******",
          "name": "******",
          "internalWebPropertyId": "2******",
          "level": "STANDARD",
          "websiteUrl": "http://1******",
          "profiles": [
            {
              "kind": "analytics#profileSummary",
              "id": "2*******",
              "name": "*",
              "type": "WEB"
            }
          ]
        }
      ]
    },
  ]
}

It seems that the permission of the service account placed in grafana can only be inquired about the first item.
You must give permission to the Graffana service account on the Google Analytics page in the array of items[2].

from grafana-google-analytics-datasource.

moovs avatar moovs commented on May 25, 2024

I did all from your manual))
maybe do you need update your installation instruction?
Screenshot 2023-09-01 at 14 07 46

from grafana-google-analytics-datasource.

lcc3108 avatar lcc3108 commented on May 25, 2024

Yes, you proceeded according to the manual.
However, in the Google Analytics Setting section, only some accounts (GA accounts, not Google accounts) were conducted.

from grafana-google-analytics-datasource.

moovs avatar moovs commented on May 25, 2024

Do you mean that I should setup all of my google analytics accounts according your manual? Not only one account that I want to use in my grafana integration?

from grafana-google-analytics-datasource.

lcc3108 avatar lcc3108 commented on May 25, 2024

@moovs
Generate JWT file can be done only once.
In the process above, one service account will be created.

You must give View permission to your service account by account in Google Analytics.
However, you only need to do an account with a profile.(This is because you need a profile to accumulate data.)
In your case, there are three UA accounts, but only one profile exists.

In other words, currently, data is accumulated only in the account below, so you only need to do the account below.

    {
      "id": "2***",
      "kind": "analytics#accountSummary",
      "webProperties": [
        {
          "kind": "analytics#webPropertySummary",
          "id": "UA-2******",
          "name": "******",
          "internalWebPropertyId": "2******",
          "level": "STANDARD",
          "websiteUrl": "http://1******",
          "profiles": [
            {
              "kind": "analytics#profileSummary",
              "id": "2*******",
              "name": "*",
              "type": "WEB"
            }
          ]
        }
      ]
    },

In my case, I have two Google Analytics accounts

  • Default Accounts for Firebase
  • test

image

You must grant permission to each account.
It's like the following picture.
image

image

Then you can look it up on Grafana as follows.

image

In your case, only 'Default Account for Firebase' has permissions that do not currently have a profile created. (Checked by log)

From version 0.2.1, you will get an error saying that you don't have the right account because you have excluded accounts that don't have a profile (data can't be retrieved) from the list.

PS
Please note that data will not be accumulated in the UA (GA3) from 2023-07-01.

This is a change on Google Analytics.

from grafana-google-analytics-datasource.

lcc3108 avatar lcc3108 commented on May 25, 2024

@asil-x
0.2.1 has been released.

If the same problem occurs in that version, please open this issue again

from grafana-google-analytics-datasource.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.