Configure the Looker data source
This document explains how to configure the Looker data source. To install the plugin, refer to Install the Looker data source plugin.
Before you begin
Before you configure the data source, ensure you have:
- Grafana permissions: The
Organization administratorrole, which you need to add and configure data sources. - A Looker instance URL: The base URL of your Looker instance, such as
https://xxxxx.looker.app. - Looker API credentials: A client ID and client secret with permission to run queries and read the models you plan to visualize.
Key concepts
If you’re new to Looker, these terms are used throughout the configuration:
Get Looker API credentials
To connect Grafana to Looker, you need a client ID and client secret from your Looker instance. To generate them, in Looker, navigate to Admin > Users, select a user, click Edit Keys, then click New API Key. For full instructions, refer to Looker API authentication.
Use credentials for a user or service account whose role and permission set grant read access to the models you want to query.
Add the data source
To add the Looker data source:
- Click Connections in the left-side menu.
- Click Add new connection.
- Type
Lookerin the search bar. - Select Looker.
- Click Add new data source.
Configure settings
Set the following options to connect to your Looker instance.
Authentication
The Looker data source authenticates to the Looker API with a client ID and client secret. Enter the Looker Client ID and Looker Client Secret from your API credentials. Grafana exchanges these credentials for a short-lived API token when it queries Looker.
Verify the connection
Click Save & test to verify the connection. On success, Grafana displays a message similar to Successfully connected to Looker. 5 LookML models found, where the number reflects the models your credentials can access.
If the test fails, refer to Troubleshoot Looker data source issues.
Provision with YAML files
You can define the Looker data source in YAML files as part of the Grafana provisioning system. For more information, refer to Provisioning Grafana.
The following example provisions a Looker data source:
apiVersion: 1
datasources:
- name: Looker
type: grafana-looker-datasource
jsonData:
base_url: https://xxxxx.looker.app
client_id: <YOUR_LOOKER_CLIENT_ID>
secureJsonData:
client_secret: <YOUR_LOOKER_CLIENT_SECRET>The following table describes the available jsonData and secureJsonData fields:
Configure Looker with Terraform
You can configure the Looker data source as code using the Grafana Terraform provider. This approach enables version-controlled, reproducible data source configurations across environments.
The following example provisions a Looker data source and defines the required variables:
terraform {
required_providers {
grafana = {
source = "grafana/grafana"
version = "~> 3.0"
}
}
}
provider "grafana" {
url = var.grafana_url
auth = var.grafana_auth
}
resource "grafana_data_source" "looker" {
type = "grafana-looker-datasource"
name = "Looker"
json_data_encoded = jsonencode({
base_url = var.looker_base_url
client_id = var.looker_client_id
})
secure_json_data_encoded = jsonencode({
client_secret = var.looker_client_secret
})
}
# Variables
variable "grafana_url" {
description = "Grafana instance URL"
type = string
default = "http://localhost:3000"
}
variable "grafana_auth" {
description = "Grafana authentication, such as admin:password or a service account token"
type = string
sensitive = true
}
variable "looker_base_url" {
description = "Base URL of your Looker instance"
type = string
}
variable "looker_client_id" {
description = "Looker API client ID"
type = string
}
variable "looker_client_secret" {
description = "Looker API client secret"
type = string
sensitive = true
}

