> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Run the Looker Connector Externally

> Configure Looker dashboard connections in OpenMetadata using YAML. Step-by-step setup guide with examples for seamless data catalog integration.

![Looker](https://docs.open-metadata.org/public/images/connectors/looker.webp)

# Looker

PROD

In this section, we provide guides and references to use the Looker connector.
Configure and schedule Looker metadata and profiler workflows from the OpenMetadata UI:

* [Requirements](#requirements)
* [Metadata Ingestion](#metadata-ingestion)

## How to Run the Connector Externally

To run the Ingestion via the UI you'll need to use the OpenMetadata Ingestion Container, which comes shipped with
custom Airflow plugins to handle the workflow deployment.

If, instead, you want to manage your workflows externally on your preferred orchestrator, you can check
the following docs to run the Ingestion Framework **anywhere**.

> [card] [External Schedulers](https://docs.open-metadata.org/v2.1.x/deployment/ingestion.md)
>
> Get more information about running the Ingestion Framework Externally

## Requirements

There are two types of metadata we ingest from Looker:

* Dashboards & Charts
* LookML Models
  For the `project` metadata being ingested:
* We get the actual LookML Project an Explore or View is developed in.
* For Dashboards, we use the folder name from the UI, since there is no other hierarchy involved there.
  In terms of permissions, we need a user with access to the Dashboards and LookML Explores that we want to ingest. You can
  create your API credentials following these [docs](https://cloud.google.com/looker/docs/api-auth).
  However, LookML Views are not present in the Looker SDK. Instead, we need to extract that information directly from
  the GitHub repository holding the source `.lkml` files. In order to get this metadata, we will require a GitHub token
  with read only access to the repository. You can follow these steps from the GitHub [documentation](https://docs.github.com/en/enterprise-server@3.4/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).

> [!TIP]
>
> The GitHub credentials are completely optional. Just note that without them, we won't be able to ingest metadata
> out of LookML Views, including their lineage to the source databases.
> Moreover, Looker lineage only supports LookML views configured with `sql_table_name` and `derived_table` in plain SQL.
> We do not yet support liquid variables.

### Python Requirements

Use Python 3.10 or later. Python 3.12 is recommended, because it is what the OpenMetadata 2.0 ingestion images use. To confirm the supported range for your release, check the `Requires-Python` metadata of that release’s `openmetadata-ingestion` package.

To run the Looker ingestion, you will need to install:

```bash theme={null}
pip3 install "openmetadata-ingestion[looker]"
```

## Metadata Ingestion

All connectors are defined as JSON Schemas.
[Here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/dashboard/lookerConnection.json)
you can find the structure to create a connection to Looker.
In order to create and run a Metadata Ingestion workflow, we will follow
the steps to create a YAML configuration able to connect to the source,
process the Entities if needed, and reach the OpenMetadata server.
The workflow is modeled around the following
[JSON Schema](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/workflow.json)

### 1. Define the YAML Config

This is a sample config for Looker:

#### Source Configuration

Configure the source type and service name for your Looker connector.

#### Client ID

**clientId**: Specify the Client ID to connect to Looker. It should have enough privileges to read all the metadata.

#### Client Secret

**clientSecret**: Client Secret to connect to Looker.

#### Host Port

**hostPort**: URL to the Looker instance.

#### GitHub Credentials

**githubCredentials** (Optional): GitHub API credentials to extract LookML Views' information by parsing the source `.lkml` files. There are three
properties we need to add in this case:

* **repositoryOwner**: The owner (user or organization) of a GitHub repository. For example, in [https://github.com/open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata), the owner is `open-metadata`.
* **repositoryName**: The name of a GitHub repository. For example, in [https://github.com/open-metadata/OpenMetadata](https://github.com/open-metadata/OpenMetadata), the name is `OpenMetadata`.
* **token**: Token to use the API. This is required for private repositories and to ensure we don't hit API limits.
  Follow these [steps](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token) in order to create a fine-grained personal access token.
  When configuring, give repository access to `Only select repositories` and choose the one containing your LookML files. Then, we only need `Repository Permissions` as `Read-only` for `Contents`.

#### Source Config

The `sourceConfig` is defined [here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/metadataIngestion/dashboardServiceMetadataPipeline.json):

* **dbServiceNames**: Database Service Names for ingesting lineage if the source supports it.
* **dashboardFilterPattern**, **chartFilterPattern**, **dataModelFilterPattern**: Note that all of them support regex as include or exclude. For example, `My dashboard`, `My dash.*`, and `.*Dashboard`.
* **projectFilterPattern**: Filter the dashboards, charts and data sources by projects. Note that all of them support regex as include or exclude. For example, `My project`, `My proj.*`, and `.*Project`.
* **includeOwners**: Set the **Include Owners** toggle to control whether to include owners to the ingested entity if the owner email matches with a user stored in the OM server as part of metadata ingestion. If the ingested entity already exists and has an owner, the owner will not be overwritten. It supports boolean values either `true` or `false`.
* **includeTags**: Optional configuration to toggle the tags ingestion. It supports boolean values either `true` or `false`.
* **includeDataModels**: Optional configuration to toggle the ingestion of data models. It supports boolean values either `true` or `false`.
* **markDeletedDashboards**: Optional configuration to soft delete dashboards in OpenMetadata if the source dashboards are deleted. Also, if the dashboard is deleted, all the associated entities like lineage, etc., with that dashboard will be deleted. It supports boolean values either `true` or `false`.
* **markDeletedDataModels**: Optional configuration to soft delete data models in OpenMetadata if the source data models are deleted. Also, if the data model is deleted, all the associated entities like lineage, etc., with that data model will be deleted. It supports boolean values either `true` or `false`.
* **includeDraftDashboard**: Optional configuration to include or exclude draft dashboards. By default it will include draft dashboards. It supports boolean values either `true` or `false`.
* **overrideMetadata**: Set the **Override Metadata** toggle to control whether to override the existing metadata in the OpenMetadata server with the metadata fetched from the source. If the toggle is set to true, the metadata fetched from the source will override the existing metadata in the OpenMetadata server. If the toggle is set to false, the metadata fetched from the source will not override the existing metadata in the OpenMetadata server. This is applicable for fields like description, tags, owner, and displayName. It supports boolean values either `true` or `false`.
* **overrideLineage**: Set the **Override Lineage** toggle to control whether to override the existing lineage. It supports boolean values either `true` or `false`.

#### Sink Configuration

To send the metadata to OpenMetadata, it needs to be specified as `type: metadata-rest`.

#### Workflow Configuration

The main property here is `openMetadataServerConfig`, where you can define the host and security provider of your OpenMetadata installation.

* **loggerLevel**: Specify the logger level depending on your needs. If you are troubleshooting an ingestion, use `DEBUG` for more detailed traces.
* **JWT token**: JWT tokens allow clients to authenticate against the OpenMetadata server. See [Enable JWT Tokens](https://docs.open-metadata.org/deployment/security/enable-jwt-tokens) and [JWT Troubleshooting](https://docs.open-metadata.org/deployment/security/jwt-troubleshooting) for more information.
* **storeServiceConnection**: If set to `true` (default), sensitive information is stored encrypted with the Fernet Key or externally if you have configured a [Secrets Manager](https://docs.open-metadata.org/deployment/secrets-manager). If set to `false`, the service is created, but the service connection information is only used by the Ingestion Framework at runtime and is not sent to the OpenMetadata server.
* **SSL configuration**: If you have added SSL to the [OpenMetadata server](https://docs.open-metadata.org/deployment/security/enable-ssl), configure the certificates for ingestion. Set `verifySSL` to `ignore`, or set it to `validate` and provide `sslConfig.caCertificate` with a local path to the server certificate. See [SSL Troubleshooting](https://docs.open-metadata.org/deployment/security/enable-ssl/ssl-troubleshooting) for more information.
* **ingestionPipelineFQN**: Fully qualified name of the ingestion pipeline, used to identify the current ingestion pipeline.

looker\_config.yaml
Copy full code

```yaml theme={null}
source:
  type: looker
  serviceName: local_looker
  serviceConnection:
    config:
      type: Looker
clientId: Client ID  # REQUIRED - Looker API client ID
clientSecret: Client Secret  # REQUIRED - Looker API client secret
hostPort: http://hostPort  # REQUIRED - Looker instance URL
gitCredentials:
        type: GitHub # Or BitBucket, depending on your hosting
        repositoryOwner: open-metadata
        repositoryName: OpenMetadata
        token: XYZ
```

```yaml theme={null}
  sourceConfig:
    config:
      type: DashboardMetadata
      # lineageInformation:
      #   dbServiceNames:
      #     - service1
      #     - service2
      # dashboardFilterPattern:
      #   includes:
      #     - dashboard1
      #     - dashboard2
      #   excludes:
      #     - dashboard3
      #     - dashboard4
      # chartFilterPattern:
      #   includes:
      #     - chart1
      #     - chart2
      #   excludes:
      #     - chart3
      #     - chart4
      # projectFilterPattern:
      #   includes:
      #     - project1
      #     - project2
      #   excludes:
      #     - project3
      #     - project4
      # dataModelFilterPattern:
      #   includes:
      #     - dataModel1
      #     - dataModel2
      #   excludes:
      #     - dataModel3
      #     - dataModel4
      # includeOwners: false # true
      # markDeletedDashboards: true # false
      # markDeletedDataModels: true # false
      # includeTags: true # false
      # includeDataModels: true # false
      # includeDraftDashboard: true # false
      # overrideMetadata: false # true
      # overrideLineage: false # true
```

```yaml theme={null}
sink:
  type: metadata-rest
  config: {}
```

```yaml theme={null}
workflowConfig:
  loggerLevel: INFO  # DEBUG, INFO, WARNING or ERROR
  openMetadataServerConfig:
    hostPort: "http://localhost:8585/api"
    authProvider: openmetadata
    securityConfig:
      jwtToken: "{bot_jwt_token}"
    ## Store the service Connection information
    storeServiceConnection: true  # false
    ## Secrets Manager Configuration
    # secretsManagerProvider: aws, azure or noop
    # secretsManagerLoader: airflow or env
    ## If SSL, fill the following
    # verifySSL: validate  # or ignore
    # sslConfig:
    #   caCertificate: /local/path/to/certificate
# ingestionPipelineFQN: <service name>.<ingestion name> ## e.g., "my_redshift.metadata"
```

### Ingest LookML Measures as Metric Entities

To ingest LookML measures as first-class **Metric** entities, set `includeMetrics` to `true` under `sourceConfig.config`. It is `false` by default, because Metric names must be unique across the whole OpenMetadata instance. It also requires `includeDataModels` to be enabled, because measures are discovered from the data models that expose them:

```yaml theme={null}
source:
  type: looker
  serviceName: local_looker
  sourceConfig:
    config:
      type: DashboardMetadata
      includeDataModels: true
      includeMetrics: true
```

### 2. Run with the CLI

First, we will need to save the YAML file. Afterward, and with all requirements installed, we can run:

```bash theme={null}
metadata ingest -c <path-to-yaml>
```

Note that from connector to connector, this recipe will always be the same. By updating the YAML configuration,
you will be able to extract metadata from different sources.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.