All Projects → doitintl → Bigquery Grafana

doitintl / Bigquery Grafana

Licence: other
Google BigQuery Datasource Plugin for Grafana.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Bigquery Grafana

Grafana Influx Dashboard
Grafana InfluxDB scripted dashboard
Stars: ✭ 130 (-30.85%)
Mutual labels:  monitoring, metrics, grafana
Spring Boot Actuator Demo
Spring Boot Actuator: Health Check, Metrics Gathering, Auditing, and Monitoring
Stars: ✭ 61 (-67.55%)
Mutual labels:  monitoring, metrics, grafana
Prometheus
Kubernetes Setup for Prometheus and Grafana
Stars: ✭ 824 (+338.3%)
Mutual labels:  monitoring, metrics, grafana
Stagemonitor
an open source solution to application performance monitoring for java server applications
Stars: ✭ 1,664 (+785.11%)
Mutual labels:  monitoring, metrics, grafana
Github Monitoring
Monitor your GitHub Repos with Docker & Prometheus
Stars: ✭ 163 (-13.3%)
Mutual labels:  monitoring, metrics, grafana
Hastic Server
Hastic data management server for analyzing patterns and anomalies from Grafana
Stars: ✭ 292 (+55.32%)
Mutual labels:  monitoring, metrics, grafana
Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+956.38%)
Mutual labels:  monitoring, metrics, grafana
Icingaweb2 Module Grafana
Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
Stars: ✭ 190 (+1.06%)
Mutual labels:  monitoring, metrics, grafana
Hastic Grafana App
Hastic data management server for labeling patterns and anomalies in Grafana
Stars: ✭ 166 (-11.7%)
Mutual labels:  monitoring, metrics, grafana
Influxgraph
Graphite InfluxDB backend. InfluxDB storage finder / plugin for Graphite API.
Stars: ✭ 87 (-53.72%)
Mutual labels:  monitoring, metrics, grafana
Questdb
An open source SQL database designed to process time series data, faster
Stars: ✭ 7,544 (+3912.77%)
Mutual labels:  monitoring, metrics, grafana
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Stars: ✭ 45,930 (+24330.85%)
Mutual labels:  monitoring, metrics, grafana
Docker Traefik Prometheus
A Docker Swarm Stack for monitoring Traefik with Promethues and Grafana
Stars: ✭ 215 (+14.36%)
Mutual labels:  monitoring, metrics, grafana
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (+197.34%)
Mutual labels:  monitoring, metrics, grafana
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (+2.66%)
Mutual labels:  monitoring, metrics, grafana
Pgwatch2
PostgreSQL metrics monitor/dashboard
Stars: ✭ 960 (+410.64%)
Mutual labels:  monitoring, metrics, grafana
Legacy Kubernetes App
Grafana App for Kubernetes
Stars: ✭ 76 (-59.57%)
Mutual labels:  monitoring, metrics, grafana
Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (-43.09%)
Mutual labels:  monitoring, metrics, grafana
Heplify Server
HEP Capture Server
Stars: ✭ 110 (-41.49%)
Mutual labels:  monitoring, metrics, grafana
Lindb
LinDB is a scalable, high performance, high availability distributed time series database.
Stars: ✭ 2,105 (+1019.68%)
Mutual labels:  monitoring, metrics

GitHub stars GitHub forks Automated Release Notes by gren

Status: Production Ready

BigQuery DataSource for Grafana

A BigQuery DataSource plugin provides support for BigQuery as a backend database.

Quick Start

There are multiple ways to install bigquery-grafana. See INSTALL for more information.

Features:

  • Query setup
  • Raw SQL editor
  • Query builder
  • Macros support
  • Additional functions
  • Table view
  • Annotations
  • BQ queries in variables
  • Sharded tables (tablename_YYYYMMDD)
  • Partitioned Tables
  • Granular slot allocation (Running queries in a project with flat-rate pricing)

Plugin Demo:

plugin demo

Adding the DataSource to Grafana

  1. Open the side menu by clicking the Grafana icon in the top header.
  2. In the side menu under Dashboards you should find a link named Data Sources.
  3. Click the + Add data source button in the top header.
  4. Select BigQuery from the Type dropdown.
  5. Upload or paste in the Service Account Key file. See below for steps on how to create a Service Account Key file.

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.

Name Description
Name The datasource name. This is how you refer to the datasource in panels & queries.
Default Default datasource means that it will be pre-selected for new panels.
Service Account Key Service Account Key File for a GCP Project. Instructions below on how to create it.

Set query priority

You can now set query priority "INTERACTIVE" or "BATCH" per datasouce

Example of Provisioning a File

You can manage DataSource via provisioning system. See the example below of a configuration file.

apiVersion: 1

datasources:
- name: <Datasource Name>
  type: doitintl-bigquery-datasource
  access: proxy
  isDefault: true
  jsonData:
       authenticationType: jwt
       clientEmail: <Service Account Email>
       defaultProject: <Default Project Name>
       tokenUri: https://oauth2.googleapis.com/token
  secureJsonData:
       privateKey: |
          -----BEGIN PRIVATE KEY-----
           <Content of the Private Key>
          -----END PRIVATE KEY-----
  version: 2
  readOnly: false

Authentication

There 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.

Using a Google Service Account Key File

To 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.

Enable APIs

Go to BigQuery API and Enable the API:

Enable GCP APIs

Create a GCP Service Account for a Project

  1. Navigate to the APIs & Services Credentials page.

  2. Click on Create credentials and choose Service account key.

  3. On the Create service account key page, choose key type JSON. Then in the Service Account dropdown, choose the New service account option:

  4. 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:

  5. 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.

  6. Upload it to Grafana on the datasource Configuration page. You can either upload the file or paste in the contents of the file.

  7. The file contents will be encrypted and saved in the Grafana database. Don't forget to save after uploading the file!

Using GCE Default Service Account

If 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.

  1. 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.
  2. Make sure the GCE virtual machine instance is being run as the service account that you just created. See instructions here.
  3. Allow access to the BigQuery API scope. See instructions here.

Read more about creating and enabling service accounts for GCE VM instances here.

Using the Query Builder

The 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:

  1. The table you want to query from

  2. The time field and metric field

  3. 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:

    a. Macro $__timeFiler with last 7 days example:

  WHERE `createDate` BETWEEN TIMESTAMP_MILLIS (1592147699012) AND TIMESTAMP_MILLIS (1592752499012) AND _PARTITIONTIME >= '2020-06-14 18:14:59' AND _PARTITIONTIME < '2020-06-21 18:14:59'

b. Macro $__timeFrom with last 7 days example:

  WHERE `createDate` > TIMESTAMP_MILLIS (1592223758609)  AND _PARTITIONTIME >= '2020-06-15 15:22:38' AND _PARTITIONTIME < '2020-06-22 15:22:38'

c. Macro $__timeTo with last 7 days example:

  WHERE `createDate` < TIMESTAMP_MILLIS (1592828659681)  AND _PARTITIONTIME >= '2020-06-15 15:24:19' AND _PARTITIONTIME < '2020-06-22 15:24:19'

You can now use timeFilter macro in raw sql mode

  1. GROUP BY option - You can use a pre-defined macro or use one of the fields from your query a. time ($__interval,none)
  2. ORDER BY option

Note: 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

Troubleshooting

Viewing your Query

  1. Use The Query Inspector located at the top of the query builder
  2. The query Inspector enables you to see the clean query and troubleshoot SQL errors
    The Query builder comes with a set of defaults which are control from the top of the Query Builder

Build

The build works with Yarn:

Development Build

yarn run build:dev

Production Build

yarn run build:prod

Tests can be run with Jest:

yarn run test

Contributing

See the Contribution Guide.

License

See the License File.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].