
Hex
BETAIn this section, we provide guides and references to use the Hex connector.
Configure and schedule Hex metadata and profiler workflows from the OpenMetadata UI:
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.
Requirements
Hex connector supports both personal and workspace tokens for authentication.
Hex Account Setup
Follow the steps below to configure the account setup for Hex connector:
Step 1: Generate API Token
To generate an API token in Hex:
- Log into your Hex account
- Navigate to Account Settings
- Go to the API Keys section
- Click on "Create API Key"
- Choose the token type:
- Personal Token: Provides access to projects you own or have access to
- Workspace Token: Provides access to all projects in the workspace (requires admin privileges)
- Copy and securely store the generated token
API tokens are shown only once when created. Make sure to copy and store them securely.
Step 2: Verify API Access
Ensure that the token has appropriate permissions:
- For personal tokens: Verify you have access to the projects you want to ingest
- For workspace tokens: Verify admin privileges are granted
Python Requirements
We have support for Python versions 3.9-3.11
To run the Hex ingestion, you will need to install:
Metadata Ingestion
All connectors are defined as JSON Schemas. Here you can find the structure to create a connection to Hex.
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
1. Define the YAML Config
This is a sample config for Hex:
Source Configuration - Service Connection
hostPort: URL to the Hex instance.
Provide the URL to your Hex instance. For Hex cloud users, use https://app.hex.tech
.
For on-premise installations, provide your custom domain URL.
tokenType: Type of authentication token.
Select the type of token you're using:
- personal: Personal access token (default) - Provides access to projects you own or have access to
- workspace: Workspace-level token - Provides access to all projects in the workspace (requires admin privileges)
token: Hex API Token.
Provide the API token generated from your Hex account. This token is used for authentication with the Hex APIs.
To generate a token:
- Log into Hex
- Go to Account Settings > API Keys
- Create a new API key
- Copy the generated token
Note: API tokens are shown only once when created. Make sure to copy and store them securely.
includeTags: Import Hex Categories and Status as Tags.
Enable this option to import Hex project categories and status as OpenMetadata tags. This helps in organizing and filtering your Hex projects within OpenMetadata.
By default, this is set to true
.
When enabled, the following will be imported as tags:
- Project categories
- Project status (e.g., published, draft)
- Other project metadata tags
Dashboard Filter Pattern:
Use regex patterns to include or exclude specific dashboards from ingestion. This helps you control which Hex projects are imported into OpenMetadata.
The filter pattern supports:
includes
: List of regex patterns for dashboards to includeexcludes
: List of regex patterns for dashboards to exclude
Examples:
- Include only production projects:
^prod-.*
- Exclude test projects:
^(?!test-).*
- Include specific project names:
^(analytics|reporting|metrics).*
Source Configuration - Source Config
The sourceConfig
is defined here:
dbServicePrefixes: List of service path prefixes for lineage matching. Supported formats: DBServiceName, DBServiceName.DatabaseName, DBServiceName.DatabaseName.SchemaName, or DBServiceName.DatabaseName.SchemaName.TableName
dashboardFilterPattern, chartFilterPattern, dataModelFilterPattern: Note that all of them support regex as include or exclude. E.g., "My dashboard, My dash.*, .*Dashboard".
projectFilterPattern: Filter the dashboards, charts and data sources by projects. Note that all of them support regex as include or exclude. E.g., "My project, My proj.*, .*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.
includeTags: Set the 'Include Tags' toggle to control whether to include tags in metadata ingestion.
includeDataModels: Set the 'Include Data Models' toggle to control whether to include tags as part of metadata ingestion.
markDeletedDashboards: Set the 'Mark Deleted Dashboards' toggle to flag dashboards as soft-deleted if they are not present anymore in the source system.
Include Draft Dashboard (toogle): Set the 'Include Draft Dashboard' toggle to include draft dashboards. By default it will include draft dashboards.
dataModelFilterPattern: Regex exclude or include data models that matches the pattern.
includeOwners:Enabling a flag will replace the current owner with a new owner from the source during metadata ingestion, if the current owner is null. It is recommended to keep the flag enabled to obtain the owner information during the first metadata ingestion.
includeOwners
supports boolean value 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.
markDeletedDashboards
supports boolean value 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 models is deleted, all the associated entities like lineage, etc., with that data models will be deleted.
includeOwners
supports boolean value either true or false.includeTags:Optional configuration to toggle the tags ingestion.
markDeletedDataModels
supports boolean value either true or false.includeDataModels: Optional configuration to toggle the ingestion of data models.
includeDataModels
supports boolean value either true or false.includeDraftDashboard: Optional Configuration to include/exclude draft dashboards. By default it will include draft dashboards.
includeDraftDashboard
supports boolean value 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.
overrideMetadata
supports boolean value either true or false.overrideLineage: Set the 'Override Lineage' toggle to control whether to override the existing lineage.
overrideLineage
supports boolean value 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 the openMetadataServerConfig
, where you can define the host and security provider of your OpenMetadata installation.
Logger Level
You can specify the loggerLevel
depending on your needs. If you are trying to troubleshoot an ingestion, running with DEBUG
will give you far more traces for identifying issues.
JWT Token
JWT tokens will allow your clients to authenticate against the OpenMetadata server. To enable JWT Tokens, you will get more details here.
You can refer to the JWT Troubleshooting section link for any issues in your JWT configuration.
Store Service Connection
If set to true
(default), we will store the sensitive information either encrypted via the Fernet Key in the database or externally, if you have configured any Secrets Manager.
If set to false
, the service will be created, but the service connection information will only be used by the Ingestion Framework at runtime, and won't be sent to the OpenMetadata server.
Store Service Connection
If set to true
(default), we will store the sensitive information either encrypted via the Fernet Key in the database or externally, if you have configured any Secrets Manager.
If set to false
, the service will be created, but the service connection information will only be used by the Ingestion Framework at runtime, and won't be sent to the OpenMetadata server.
SSL Configuration
If you have added SSL to the OpenMetadata server, then you will need to handle the certificates when running the ingestion too. You can either set verifySSL
to ignore
, or have it as validate
, which will require you to set the sslConfig.caCertificate
with a local path where your ingestion runs that points to the server certificate file.
Find more information on how to troubleshoot SSL issues here.
ingestionPipelineFQN
Fully qualified name of ingestion pipeline, used to identify the current ingestion pipeline.
2. Run with the CLI
First, we will need to save the YAML file. Afterward, and with all requirements installed, we can run:
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.
Advanced Configuration
Working with Multiple Workspaces
If you need to ingest metadata from multiple Hex workspaces, you can:
- Use Workspace Tokens: If you have admin access, use workspace tokens to access all projects in each workspace
- Create Multiple Services: Create separate Hex services in OpenMetadata for each workspace
- Use Filter Patterns: Apply filter patterns to organize projects by workspace
Scheduling Ingestion
For production environments, consider:
- Setting up regular ingestion schedules (e.g., daily or hourly)
- Using workflow orchestration tools like Airflow
- Monitoring ingestion logs for failures
- Setting up alerts for ingestion issues
Performance Optimization
For large Hex deployments:
- Use filter patterns to limit the scope of ingestion
- Consider running ingestion during off-peak hours
- Monitor API rate limits and adjust accordingly
- Use incremental ingestion where possible
Lineage
Hex connector extracts lineage information by:
- Warehouse Query History: Directly queries data warehouse logs (Snowflake, BigQuery, Databricks, Redshift, etc.) to find queries executed by Hex
- Hex Metadata Identification: Identifies Hex-originated queries using metadata comments embedded by Hex containing project IDs
- SQL Parsing: Analyzes the discovered SQL queries to extract upstream table dependencies
Lineage Configuration
To configure lineage extraction, add the lineageInformation
section with dbServicePrefixes
to specify which database services to query:
Troubleshooting
Common Issues
Authentication Failures
Solution:
- Verify your API token is valid and hasn't expired
- Check that the token type matches your access level
- Ensure the token has necessary permissions
Missing Projects
Solution:
- For personal tokens: Verify you have access to the projects
- For workspace tokens: Confirm admin privileges
- Review dashboard filter patterns
Connection Timeouts
Solution:
- Verify the hostPort URL is correct
- Check network connectivity
- For on-premise installations, ensure firewall rules allow access
Rate Limiting
Solution:
- Reduce ingestion frequency
- Contact Hex support for rate limit increases
- Implement exponential backoff in retry logic
Debug Mode
To enable debug logging for troubleshooting:
This will provide detailed logs about:
- API calls being made
- Response data received
- Processing steps
- Any errors or warnings
2. Run with the CLI
First, we will need to save the YAML file. Afterward, and with all requirements installed, we can run:
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.