You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for service account impersonation (#344)
This PR is the same as
#336 but uses
the new versions of the sdks with the required changes.
<img width="694" alt="Screenshot 2025-06-17 at 11 59 16"
src="https://github.com/user-attachments/assets/04366635-24ba-4879-918b-ad53886bb396"
/>
### How to test it:
- Use `raintank-dev` project.
- I created a service account called
`bigqueryim@raintank-dev.iam.gserviceaccount.com`. This sa only has
`Service Account Token Creator` role. Create a new key for the service
account or ask me for it.
- Create a new data source with the jwt key for
`bigqueryim@raintank-dev.iam.gserviceaccount.com`
- Check Enable under Service account impersonation
- Add `bq-dev@raintank-dev.iam.gserviceaccount.com` to the `Service
account to impersonate` field
- Create a simple query in explore
Fixes#310
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,11 @@ Google BigQuery datasource provides two ways of authentication:
42
42
43
43
When Grafana is running on a Google Compute Engine (GCE) virtual machine, it is possible for the Google BigQuery datasource to automatically retrieve the default project id and authentication token from the metadata server. For this to work, you need to make sure that you have a service account that is setup as the default account for the virtual machine and that the service account has been given read access to the BigQuery API.
44
44
45
+
### Service account impersonation
46
+
47
+
You can also configure the plugin to use [service account impersonation](https://cloud.google.com/iam/docs/service-account-impersonation).
48
+
You need to ensure the service account used by this plugin has the `iam.serviceAccounts.getAccessToken` permission. This permission is in roles like the [Service Account Token Creator role](https://cloud.google.com/iam/docs/roles-permissions/iam#iam.serviceAccountTokenCreator) (roles/iam.serviceAccountTokenCreator). Also, the service account impersonated by this plugin needs [BigQuery Data Viewer](https://cloud.google.com/iam/docs/roles-permissions/bigquery#bigquery.dataViewer) and [BigQuery Job User](https://cloud.google.com/iam/docs/roles-permissions/bigquery#bigquery.jobUser) roles.
49
+
45
50
### Provisioning
46
51
47
52
It is possible to configure data sources using configuration files with Grafana’s provisioning system. To read about how it works, including and all the settings that you can set for this data source, refer to [Provisioning Grafana data sources](https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources).
0 commit comments