{"id":15060690,"url":"https://github.com/doitintl/bigquery-grafana","last_synced_at":"2025-10-04T19:31:46.540Z","repository":{"id":34587417,"uuid":"171870004","full_name":"doitintl/bigquery-grafana","owner":"doitintl","description":"Google BigQuery Datasource Plugin for Grafana. (NO LONGER MAINTAINED)","archived":true,"fork":false,"pushed_at":"2022-09-08T13:58:01.000Z","size":293608,"stargazers_count":241,"open_issues_count":0,"forks_count":81,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-09-30T12:50:43.981Z","etag":null,"topics":["bigquery","bigquery-datasource","google-bigquery","google-cloud-platform","grafana","grafana-bigquery","grafana-bigquery-datasource","grafana-datasource","metrics","monitoring","typescript"],"latest_commit_sha":null,"homepage":"https://www.doit-intl.com/labs/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doitintl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"spark2ignite","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-02-21T12:43:41.000Z","updated_at":"2025-09-22T13:18:22.000Z","dependencies_parsed_at":"2022-08-25T21:01:45.225Z","dependency_job_id":null,"html_url":"https://github.com/doitintl/bigquery-grafana","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/doitintl/bigquery-grafana","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Fbigquery-grafana","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Fbigquery-grafana/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Fbigquery-grafana/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Fbigquery-grafana/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doitintl","download_url":"https://codeload.github.com/doitintl/bigquery-grafana/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doitintl%2Fbigquery-grafana/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278365883,"owners_count":25975087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","bigquery-datasource","google-bigquery","google-cloud-platform","grafana","grafana-bigquery","grafana-bigquery-datasource","grafana-datasource","metrics","monitoring","typescript"],"created_at":"2024-09-24T23:03:07.923Z","updated_at":"2025-10-04T19:31:41.527Z","avatar_url":"https://github.com/doitintl.png","language":"TypeScript","funding_links":["https://github.com/sponsors/spark2ignite"],"categories":[],"sub_categories":[],"readme":"### We have retired the [DoiT International BigQuery DataSource plugin](https://grafana.com/grafana/plugins/doitintl-bigquery-datasource/) for Grafana, ceased all development, and put maintenance on indefinite hold. We recommend you migrate to the official [Google BigQuery data source](https://grafana.com/grafana/plugins/grafana-bigquery-datasource/) maintained by Grafana.\n\n---\n\n[![GitHub stars](https://img.shields.io/github/stars/doitintl/bigquery-grafana.svg?style=svg)](https://github.com/doitintl/bigquery-grafana/stargazers)\n![GitHub forks](https://img.shields.io/github/forks/doitintl/bigquery-grafana.svg?style=svg)\n[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)\n\n# BigQuery DataSource for Grafana\n\nA production-ready BigQuery DataSource plugin that provides support for [BigQuery](https://cloud.google.com/bigquery/) as a backend database.\n\n### Quick Start\n\nThere are multiple ways to install bigquery-grafana. See [INSTALL](https://doitintl.github.io/bigquery-grafana/INSTALL) for more information.\n\n### Features:\n\n- Query setup\n- Raw SQL editor\n- Query builder\n- Macros support\n- Additional functions\n- Table view\n- Annotations\n- BQ queries in variables\n- Sharded tables (`tablename_YYYYMMDD`)\n- Partitioned Tables\n- Granular slot allocation (Running queries in a project with flat-rate pricing)\n\n**Plugin Demo:**\n\n![plugin demo](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/grafana-bigquery-demo.gif)\n\n## Adding the DataSource to Grafana\n\n1. Open the side menu by clicking the Grafana icon in the top header.\n2. In the side menu under `Dashboards` you should find a link named `Data Sources`.\n3. Click the `+ Add data source` button in the top header.\n4. Select `BigQuery` from the _Type_ dropdown.\n5. Upload or paste in the Service Account Key file. See below for steps on how to create a Service Account Key file.\n\n\u003e NOTE: If you're not seeing the `Data Sources` link in your side menu it means that your current user does not have the `Admin` role for the current organization.\n\n| Name                  | Description                                                                         |\n| --------------------- | ----------------------------------------------------------------------------------- |\n| _Name_                | The datasource name. This is how you refer to the datasource in panels \u0026 queries.   |\n| _Default_             | Default datasource means that it will be pre-selected for new panels.               |\n| _Service Account Key_ | Service Account Key File for a GCP Project. Instructions below on how to create it. |\n\n### Set query priority\n\nYou can now set query priority \"INTERACTIVE\" or \"BATCH\" per datasouce\n![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/QueryPriority.png)\n\n### Example of Provisioning a File\n\nYou can manage DataSource via [provisioning system](https://grafana.com/docs/administration/provisioning/#datasources). See the example below of a configuration file.\n\n```\napiVersion: 1\n\ndatasources:\n- name: \u003cDatasource Name\u003e\n  type: doitintl-bigquery-datasource\n  access: proxy\n  isDefault: true\n  jsonData:\n       authenticationType: jwt\n       clientEmail: \u003cService Account Email\u003e\n       defaultProject: \u003cDefault Project Name\u003e\n       tokenUri: https://oauth2.googleapis.com/token\n  secureJsonData:\n       privateKey: |\n          -----BEGIN PRIVATE KEY-----\n           \u003cContent of the Private Key\u003e\n          -----END PRIVATE KEY-----\n  version: 2\n  readOnly: false\n```\n\n## Authentication\n\nThere are two ways to authenticate the BigQuery plugin - either by uploading a Google JWT file, or by automatically retrieving credentials from Google's metadata server. The latter is only available when running Grafana on a GCE virtual machine.\n\n### Using a Google Service Account Key File\n\nTo authenticate with the BigQuery API, you need to create a Google Cloud Platform (GCP) Service Account for the Project you want to show data for. A Grafana datasource integrates with one GCP Project. If you want to visualize data from multiple GCP Projects then you can give the service account permissions in each project or create one datasource per GCP Project.\n\n#### Enable APIs\n\nGo to [BigQuery API](https://console.cloud.google.com/apis/library/bigquery.googleapis.com) and `Enable` the API:\n\n![Enable GCP APIs](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/bigquery_enable_api.png)\n\n#### Create a GCP Service Account for a Project\n\n1. Navigate to the [APIs \u0026 Services Credentials page](https://console.cloud.google.com/apis/credentials).\n2. Click on `Create credentials` and choose `Service account key`.\n\n   ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/createserviceaccountbutton.png)\n\n3. On the `Create service account key` page, choose key type `JSON`. Then in the `Service Account` dropdown, choose the `New service account` option:\n\n   ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/newserviceaccount.png)\n\n4. Some new fields will appear. Fill in a name for the service account in the `Service account name` field and then choose the `BigQuery Data Viewer` and `BigQuery Job User` roles from the `Role` dropdown:\n\n   ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/bq_service_account_choose_role.png)\n\n5. Click the `Create` button. A JSON key file will be created and downloaded to your computer. Store this file in a secure place as it allows access to your BigQuery data.\n6. Upload it to Grafana on the datasource Configuration page. You can either upload the file or paste in the contents of the file.\n\n   ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/bq__grafana_upload_key.png)\n\n7. The file contents will be encrypted and saved in the Grafana database. Don't forget to save after uploading the file!\n\n   ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/bq_grafana_key_uploaded.png)\n\n### Using GCE Default Service Account\n\nIf Grafana is running on a Google Compute Engine (GCE) virtual machine, it is possible for Grafana to automatically retrieve default credentials from the metadata server. This has the advantage of not needing to generate a private key file for the service account and also not having to upload the file to Grafana. However for this to work, there are a few preconditions that need to be met.\n\n1. First of all, you need to create a Service Account that can be used by the GCE virtual machine. See detailed instructions on how to do that [here](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#createanewserviceaccount).\n2. Make sure the GCE virtual machine instance is being run as the service account that you just created. See instructions [here](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#using).\n3. Allow access to the `BigQuery API` scope. See instructions [here](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes).\n\nRead more about creating and enabling service accounts for GCE VM instances [here](https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances).\n\n### Using the Query Builder\n\nThe query builder provides a simple yet a user-friendly interface to help you quickly compose a query. The builder enables you to define the basic parts of your query, The common ones are:\n\n1. The table you want to query from\n2. The time field and metric field\n3. WHERE clause - Either use one of the pre-defined macros, to speed your writing time, or set up your own expression. Existing supported Macros are:\n\n   a. Macro $__timeFiler with last 7 days example:\n\n```\n  WHERE `createDate` BETWEEN TIMESTAMP_MILLIS (1592147699012) AND TIMESTAMP_MILLIS (1592752499012) AND _PARTITIONTIME \u003e= '2020-06-14 18:14:59' AND _PARTITIONTIME \u003c '2020-06-21 18:14:59'\n```\n\nb. Macro $__timeFrom with last 7 days example:\n\n```\n  WHERE `createDate` \u003e TIMESTAMP_MILLIS (1592223758609)  AND _PARTITIONTIME \u003e= '2020-06-15 15:22:38' AND _PARTITIONTIME \u003c '2020-06-22 15:22:38'\n```\n\nc. Macro $__timeTo with last 7 days example:\n\n```\n  WHERE `createDate` \u003c TIMESTAMP_MILLIS (1592828659681)  AND _PARTITIONTIME \u003e= '2020-06-15 15:24:19' AND _PARTITIONTIME \u003c '2020-06-22 15:24:19'\n```\n\nYou can now use timeFilter macro in raw sql mode\n\n4. GROUP BY option - You can use a pre-defined macro or use one of the fields from your query\n   a. time ($__interval,none)\n5. ORDER BY option\n\nNote: If your processing location is not the Default US one set your location from the processing Location drop-down at the top right bottom of the query builder\n\n### Troubleshooting\n\nViewing your Query\n\n1.  Use The Query Inspector located at the top of the query builder\n    ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/QueryInspector.png)\n2.  The query Inspector enables you to see the clean query and troubleshoot SQL errors\n    ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/InspectPanel.png)\n     The Query builder comes with a set of defaults which are control from the top of the Query Builder\n    ![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/QueryBuilder.png)\n\n![](https://raw.githubusercontent.com/doitintl/bigquery-grafana/master/img/QueryOptions.png)\n\n### Build\n\nThe build works with Yarn:\n\n#### Development Build\n\n```\nyarn run build:dev\n```\n\n#### Production Build\n\n```\nyarn run build:prod\n```\n\nTests can be run with Jest:\n\n```\nyarn run test\n```\n\n## Contributing\n\nSee the [CONTRIBUTING](https://doitintl.github.io/bigquery-grafana/CONTRIBUTING) file.\n\n## License\n\nSee the [LICENSE](https://doitintl.github.io/bigquery-grafana/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoitintl%2Fbigquery-grafana","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoitintl%2Fbigquery-grafana","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoitintl%2Fbigquery-grafana/lists"}