@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
343 lines (342 loc) • 14.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* NOTE: This resource has been deprecated and will be removed soon. Please use the databricks.QualityMonitor resource instead.
*
* This resource allows you to manage [Lakehouse Monitors](https://docs.databricks.com/en/lakehouse-monitoring/index.html) in Databricks.
*
* A `databricks.LakehouseMonitor` is attached to a databricks.SqlTable and can be of type timeseries, snapshot or inference.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const sandbox = new databricks.Catalog("sandbox", {
* name: "sandbox",
* comment: "this catalog is managed by terraform",
* properties: {
* purpose: "testing",
* },
* });
* const things = new databricks.Schema("things", {
* catalogName: sandbox.id,
* name: "things",
* comment: "this database is managed by terraform",
* properties: {
* kind: "various",
* },
* });
* const myTestTable = new databricks.SqlTable("myTestTable", {
* catalogName: "main",
* schemaName: things.name,
* name: "bar",
* tableType: "MANAGED",
* dataSourceFormat: "DELTA",
* columns: [{
* name: "timestamp",
* type: "int",
* }],
* });
* const testTimeseriesMonitor = new databricks.LakehouseMonitor("testTimeseriesMonitor", {
* tableName: pulumi.interpolate`${sandbox.name}.${things.name}.${myTestTable.name}`,
* assetsDir: pulumi.interpolate`/Shared/provider-test/databricks_lakehouse_monitoring/${myTestTable.name}`,
* outputSchemaName: pulumi.interpolate`${sandbox.name}.${things.name}`,
* timeSeries: {
* granularities: ["1 hour"],
* timestampCol: "timestamp",
* },
* });
* ```
*
* ### Inference Monitor
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const testMonitorInference = new databricks.LakehouseMonitor("testMonitorInference", {
* tableName: `${sandbox.name}.${things.name}.${myTestTable.name}`,
* assetsDir: `/Shared/provider-test/databricks_lakehouse_monitoring/${myTestTable.name}`,
* outputSchemaName: `${sandbox.name}.${things.name}`,
* inferenceLog: {
* granularities: ["1 hour"],
* timestampCol: "timestamp",
* predictionCol: "prediction",
* modelIdCol: "model_id",
* problemType: "PROBLEM_TYPE_REGRESSION",
* },
* });
* ```
* ### Snapshot Monitor
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const testMonitorInference = new databricks.LakehouseMonitor("testMonitorInference", {
* tableName: `${sandbox.name}.${things.name}.${myTestTable.name}`,
* assetsDir: `/Shared/provider-test/databricks_lakehouse_monitoring/${myTestTable.name}`,
* outputSchemaName: `${sandbox.name}.${things.name}`,
* snapshot: {},
* });
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * databricks.Catalog
* * databricks.Schema
* * databricks.SqlTable
*/
export declare class LakehouseMonitor extends pulumi.CustomResource {
/**
* Get an existing LakehouseMonitor resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LakehouseMonitorState, opts?: pulumi.CustomResourceOptions): LakehouseMonitor;
/**
* Returns true if the given object is an instance of LakehouseMonitor. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is LakehouseMonitor;
/**
* The directory to store the monitoring assets (Eg. Dashboard and Metric Tables)
*/
readonly assetsDir: pulumi.Output<string>;
/**
* Name of the baseline table from which drift metrics are computed from.Columns in the monitored table should also be present in the baseline
* table.
*/
readonly baselineTableName: pulumi.Output<string | undefined>;
/**
* Custom metrics to compute on the monitored table. These can be aggregate metrics, derived metrics (from already computed aggregate metrics), or drift metrics (comparing metrics across time windows).
*/
readonly customMetrics: pulumi.Output<outputs.LakehouseMonitorCustomMetric[] | undefined>;
/**
* The ID of the generated dashboard.
*/
readonly dashboardId: pulumi.Output<string>;
/**
* The data classification config for the monitor
*/
readonly dataClassificationConfig: pulumi.Output<outputs.LakehouseMonitorDataClassificationConfig | undefined>;
/**
* The full name of the drift metrics table. Format: __catalog_name__.__schema_name__.__table_name__.
*/
readonly driftMetricsTableName: pulumi.Output<string>;
/**
* Configuration for the inference log monitor
*/
readonly inferenceLog: pulumi.Output<outputs.LakehouseMonitorInferenceLog | undefined>;
readonly latestMonitorFailureMsg: pulumi.Output<string | undefined>;
/**
* The version of the monitor config (e.g. 1,2,3). If negative, the monitor may be corrupted
*/
readonly monitorVersion: pulumi.Output<string>;
/**
* The notification settings for the monitor. The following optional blocks are supported, each consisting of the single string array field with name `emailAddresses` containing a list of emails to notify:
*/
readonly notifications: pulumi.Output<outputs.LakehouseMonitorNotifications | undefined>;
/**
* Schema where output metric tables are created
*/
readonly outputSchemaName: pulumi.Output<string>;
/**
* The full name of the profile metrics table. Format: __catalog_name__.__schema_name__.__table_name__.
*/
readonly profileMetricsTableName: pulumi.Output<string>;
/**
* The schedule for automatically updating and refreshing metric tables. This block consists of following fields:
*/
readonly schedule: pulumi.Output<outputs.LakehouseMonitorSchedule | undefined>;
/**
* Whether to skip creating a default dashboard summarizing data quality metrics.
*/
readonly skipBuiltinDashboard: pulumi.Output<boolean | undefined>;
/**
* List of column expressions to slice data with for targeted analysis. The data is grouped by each expression independently, resulting in a separate slice for each predicate and its complements. For high-cardinality columns, only the top 100 unique values by frequency will generate slices.
*/
readonly slicingExprs: pulumi.Output<string[] | undefined>;
/**
* Configuration for monitoring snapshot tables.
*/
readonly snapshot: pulumi.Output<outputs.LakehouseMonitorSnapshot | undefined>;
/**
* Status of the Monitor
*/
readonly status: pulumi.Output<string>;
/**
* The full name of the table to attach the monitor too. Its of the format {catalog}.{schema}.{tableName}
*/
readonly tableName: pulumi.Output<string>;
/**
* Configuration for monitoring timeseries tables.
*/
readonly timeSeries: pulumi.Output<outputs.LakehouseMonitorTimeSeries | undefined>;
/**
* Optional argument to specify the warehouse for dashboard creation. If not specified, the first running warehouse will be used.
*/
readonly warehouseId: pulumi.Output<string | undefined>;
/**
* Create a LakehouseMonitor resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: LakehouseMonitorArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering LakehouseMonitor resources.
*/
export interface LakehouseMonitorState {
/**
* The directory to store the monitoring assets (Eg. Dashboard and Metric Tables)
*/
assetsDir?: pulumi.Input<string>;
/**
* Name of the baseline table from which drift metrics are computed from.Columns in the monitored table should also be present in the baseline
* table.
*/
baselineTableName?: pulumi.Input<string>;
/**
* Custom metrics to compute on the monitored table. These can be aggregate metrics, derived metrics (from already computed aggregate metrics), or drift metrics (comparing metrics across time windows).
*/
customMetrics?: pulumi.Input<pulumi.Input<inputs.LakehouseMonitorCustomMetric>[]>;
/**
* The ID of the generated dashboard.
*/
dashboardId?: pulumi.Input<string>;
/**
* The data classification config for the monitor
*/
dataClassificationConfig?: pulumi.Input<inputs.LakehouseMonitorDataClassificationConfig>;
/**
* The full name of the drift metrics table. Format: __catalog_name__.__schema_name__.__table_name__.
*/
driftMetricsTableName?: pulumi.Input<string>;
/**
* Configuration for the inference log monitor
*/
inferenceLog?: pulumi.Input<inputs.LakehouseMonitorInferenceLog>;
latestMonitorFailureMsg?: pulumi.Input<string>;
/**
* The version of the monitor config (e.g. 1,2,3). If negative, the monitor may be corrupted
*/
monitorVersion?: pulumi.Input<string>;
/**
* The notification settings for the monitor. The following optional blocks are supported, each consisting of the single string array field with name `emailAddresses` containing a list of emails to notify:
*/
notifications?: pulumi.Input<inputs.LakehouseMonitorNotifications>;
/**
* Schema where output metric tables are created
*/
outputSchemaName?: pulumi.Input<string>;
/**
* The full name of the profile metrics table. Format: __catalog_name__.__schema_name__.__table_name__.
*/
profileMetricsTableName?: pulumi.Input<string>;
/**
* The schedule for automatically updating and refreshing metric tables. This block consists of following fields:
*/
schedule?: pulumi.Input<inputs.LakehouseMonitorSchedule>;
/**
* Whether to skip creating a default dashboard summarizing data quality metrics.
*/
skipBuiltinDashboard?: pulumi.Input<boolean>;
/**
* List of column expressions to slice data with for targeted analysis. The data is grouped by each expression independently, resulting in a separate slice for each predicate and its complements. For high-cardinality columns, only the top 100 unique values by frequency will generate slices.
*/
slicingExprs?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Configuration for monitoring snapshot tables.
*/
snapshot?: pulumi.Input<inputs.LakehouseMonitorSnapshot>;
/**
* Status of the Monitor
*/
status?: pulumi.Input<string>;
/**
* The full name of the table to attach the monitor too. Its of the format {catalog}.{schema}.{tableName}
*/
tableName?: pulumi.Input<string>;
/**
* Configuration for monitoring timeseries tables.
*/
timeSeries?: pulumi.Input<inputs.LakehouseMonitorTimeSeries>;
/**
* Optional argument to specify the warehouse for dashboard creation. If not specified, the first running warehouse will be used.
*/
warehouseId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a LakehouseMonitor resource.
*/
export interface LakehouseMonitorArgs {
/**
* The directory to store the monitoring assets (Eg. Dashboard and Metric Tables)
*/
assetsDir: pulumi.Input<string>;
/**
* Name of the baseline table from which drift metrics are computed from.Columns in the monitored table should also be present in the baseline
* table.
*/
baselineTableName?: pulumi.Input<string>;
/**
* Custom metrics to compute on the monitored table. These can be aggregate metrics, derived metrics (from already computed aggregate metrics), or drift metrics (comparing metrics across time windows).
*/
customMetrics?: pulumi.Input<pulumi.Input<inputs.LakehouseMonitorCustomMetric>[]>;
/**
* The data classification config for the monitor
*/
dataClassificationConfig?: pulumi.Input<inputs.LakehouseMonitorDataClassificationConfig>;
/**
* Configuration for the inference log monitor
*/
inferenceLog?: pulumi.Input<inputs.LakehouseMonitorInferenceLog>;
latestMonitorFailureMsg?: pulumi.Input<string>;
/**
* The notification settings for the monitor. The following optional blocks are supported, each consisting of the single string array field with name `emailAddresses` containing a list of emails to notify:
*/
notifications?: pulumi.Input<inputs.LakehouseMonitorNotifications>;
/**
* Schema where output metric tables are created
*/
outputSchemaName: pulumi.Input<string>;
/**
* The schedule for automatically updating and refreshing metric tables. This block consists of following fields:
*/
schedule?: pulumi.Input<inputs.LakehouseMonitorSchedule>;
/**
* Whether to skip creating a default dashboard summarizing data quality metrics.
*/
skipBuiltinDashboard?: pulumi.Input<boolean>;
/**
* List of column expressions to slice data with for targeted analysis. The data is grouped by each expression independently, resulting in a separate slice for each predicate and its complements. For high-cardinality columns, only the top 100 unique values by frequency will generate slices.
*/
slicingExprs?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Configuration for monitoring snapshot tables.
*/
snapshot?: pulumi.Input<inputs.LakehouseMonitorSnapshot>;
/**
* The full name of the table to attach the monitor too. Its of the format {catalog}.{schema}.{tableName}
*/
tableName: pulumi.Input<string>;
/**
* Configuration for monitoring timeseries tables.
*/
timeSeries?: pulumi.Input<inputs.LakehouseMonitorTimeSeries>;
/**
* Optional argument to specify the warehouse for dashboard creation. If not specified, the first running warehouse will be used.
*/
warehouseId?: pulumi.Input<string>;
}