> ## 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 Grafana Connector Externally

> Learn to run the Grafana connector externally in OpenMetadata. Configure metadata ingestion via YAML, including Service Account Token auth, lineage, and SSL setup.

![Grafana](https://docs.open-metadata.org/public/images/connectors/grafana.png)

# Grafana

BETA

In this section, we provide guides and references to use the Grafana connector.
Configure and schedule Grafana 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

You will need:

* Grafana 9.0+ (Service Account Tokens)
* Service Account Token with Admin role (for full metadata extraction)
* Network access to Grafana API endpoints

### 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 Grafana ingestion, install:

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

## 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/grafanaConnection.json)
you can find the structure to create a connection to Grafana.
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.

### 1. Define the YAML Config

This is a sample config for Grafana:

#### Source Configuration

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

#### Host Port

**hostPort**: URL or IP address of your Grafana instance.

#### API Key

**apiKey**: Service Account Token for authentication (format: `glsa_xxxxx`). Admin role recommended.

#### Verify SSL

**verifySSL**: (Optional) Whether to verify SSL certificates. Default: true

#### Include Tags

**includeTags**: When set to true, imports Grafana tags as OpenMetadata tags.

#### Lineage Information

Configure database service prefixes for lineage extraction.

#### Source Config

#### Sink Configuration

To send the metadata to OpenMetadata, specify `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.

grafana\_config.yaml
Copy full code

```yaml theme={null}
source:
  type: grafana
  serviceName: local_grafana
  serviceConnection:
    config:
      type: Grafana
      hostPort: https://grafana.example.com
      apiKey: glsa_xxxxxxxxxxxxxxxxxxxx
      verifySSL: true
sourceConfig:
  config:
    type: DashboardMetadata
    includeTags: true
    lineageInformation:
      dbServicePrefixes: ["mysql", "postgres"]
sink:
  type: metadata-rest
  config: {}
workflowConfig:
  openMetadataServerConfig:
    hostPort: <OpenMetadata host and port>
    authProvider: <OpenMetadata auth provider>
```

## Securing Grafana Connection with SSL in OpenMetadata

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