Integrating direct Google BigQuery usage with Dagster Cloud Insights (Experimental)#
This feature is considered experimental.
External metrics, such as Google BigQuery usage, can be integrated into the Dagster Insights UI. The dagster-cloud package contains utilities for capturing and submitting external metrics about data operations to Dagster Cloud via an API.
BigQuery credentials that have access to the INFORMATION_SCHEMA.JOBS table. For more information on granting access to this table, see the BigQuery documentation.
To install the following libraries:
pip install dagster dagster-cloud dagster-gcp
Note: If you already have dagster-cloud installed, make sure you're using version 1.7.0 or newer.
The first step is to replace any existing BigQuery resources with InsightsBigQueryResource. This resource is a drop-in replacement for the BigQueryResource resource, but it also emits BigQuery usage metrics to the Dagster Cloud Insights API.
from dagster_cloud.dagster_insights import InsightsBigQueryResource
defs = Definitions(
resources={"bigquery": InsightsBigQueryResource(project="my-project")})