Skip to main content

model_deployment_monitoring_jobs

Creates, updates, deletes, gets or lists a model_deployment_monitoring_jobs resource.

Overview

Namemodel_deployment_monitoring_jobs
TypeResource
Idgoogle.aiplatform.model_deployment_monitoring_jobs

Fields

NameDatatypeDescription
namestringOutput only. Resource name of a ModelDeploymentMonitoringJob.
analysisInstanceSchemaUristringYAML schema file uri describing the format of a single instance that you want Tensorflow Data Validation (TFDV) to analyze. If this field is empty, all the feature data types are inferred from predict_instance_schema_uri, meaning that TFDV will use the data in the exact format(data type) as prediction request/response. If there are any data type differences between predict instance and TFDV instance, this field can be used to override the schema. For models trained with Vertex AI, this field must be set as all the fields in predict instance formatted as string.
bigqueryTablesarrayOutput only. The created bigquery tables for the job under customer project. Customer could do their own query & analysis. There could be 4 log tables in maximum: 1. Training data logging predict request/response 2. Serving data logging predict request/response
createTimestringOutput only. Timestamp when this ModelDeploymentMonitoringJob was created.
displayNamestringRequired. The user-defined name of the ModelDeploymentMonitoringJob. The name can be up to 128 characters long and can consist of any UTF-8 characters. Display name of a ModelDeploymentMonitoringJob.
enableMonitoringPipelineLogsbooleanIf true, the scheduled monitoring pipeline logs are sent to Google Cloud Logging, including pipeline status and anomalies detected. Please note the logs incur cost, which are subject to Cloud Logging pricing.
encryptionSpecobjectRepresents a customer-managed encryption key spec that can be applied to a top-level resource.
endpointstringRequired. Endpoint resource name. Format: projects/{project}/locations/{location}/endpoints/{endpoint}
errorobjectThe Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
labelsobjectThe labels with user-defined metadata to organize your ModelDeploymentMonitoringJob. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
latestMonitoringPipelineMetadataobjectAll metadata of most recent monitoring pipelines.
logTtlstringThe TTL of BigQuery tables in user projects which stores logs. A day is the basic unit of the TTL and we take the ceil of TTL/86400(a day). e.g. { second: 3600} indicates ttl = 1 day.
loggingSamplingStrategyobjectSampling Strategy for logging, can be for both training and prediction dataset.
modelDeploymentMonitoringObjectiveConfigsarrayRequired. The config for monitoring objectives. This is a per DeployedModel config. Each DeployedModel needs to be configured separately.
modelDeploymentMonitoringScheduleConfigobjectThe config for scheduling monitoring job.
modelMonitoringAlertConfigobjectThe alert config for model monitoring.
nextScheduleTimestringOutput only. Timestamp when this monitoring pipeline will be scheduled to run for the next round.
predictInstanceSchemaUristringYAML schema file uri describing the format of a single instance, which are given to format this Endpoint's prediction (and explanation). If not set, we will generate predict schema from collected predict requests.
samplePredictInstanceanySample Predict instance, same format as PredictRequest.instances, this can be set as a replacement of ModelDeploymentMonitoringJob.predict_instance_schema_uri. If not set, we will generate predict schema from collected predict requests.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
scheduleStatestringOutput only. Schedule state when the monitoring job is in Running state.
statestringOutput only. The detailed state of the monitoring job. When the job is still creating, the state will be 'PENDING'. Once the job is successfully created, the state will be 'RUNNING'. Pause the job, the state will be 'PAUSED'. Resume the job, the state will return to 'RUNNING'.
statsAnomaliesBaseDirectoryobjectThe Google Cloud Storage location where the output is to be written to.
updateTimestringOutput only. Timestamp when this ModelDeploymentMonitoringJob was updated most recently.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, modelDeploymentMonitoringJobsId, projectsIdGets a ModelDeploymentMonitoringJob.
listSELECTlocationsId, projectsIdLists ModelDeploymentMonitoringJobs in a Location.
createINSERTlocationsId, projectsIdCreates a ModelDeploymentMonitoringJob. It will run periodically on a configured interval.
deleteDELETElocationsId, modelDeploymentMonitoringJobsId, projectsIdDeletes a ModelDeploymentMonitoringJob.
patchUPDATElocationsId, modelDeploymentMonitoringJobsId, projectsIdUpdates a ModelDeploymentMonitoringJob.
pauseEXEClocationsId, modelDeploymentMonitoringJobsId, projectsIdPauses a ModelDeploymentMonitoringJob. If the job is running, the server makes a best effort to cancel the job. Will mark ModelDeploymentMonitoringJob.state to 'PAUSED'.
resumeEXEClocationsId, modelDeploymentMonitoringJobsId, projectsIdResumes a paused ModelDeploymentMonitoringJob. It will start to run from next scheduled time. A deleted ModelDeploymentMonitoringJob can't be resumed.
search_model_deployment_monitoring_stats_anomaliesEXEClocationsId, modelDeploymentMonitoringJobsId, projectsIdSearches Model Monitoring Statistics generated within a given time window.

SELECT examples

Lists ModelDeploymentMonitoringJobs in a Location.

SELECT
name,
analysisInstanceSchemaUri,
bigqueryTables,
createTime,
displayName,
enableMonitoringPipelineLogs,
encryptionSpec,
endpoint,
error,
labels,
latestMonitoringPipelineMetadata,
logTtl,
loggingSamplingStrategy,
modelDeploymentMonitoringObjectiveConfigs,
modelDeploymentMonitoringScheduleConfig,
modelMonitoringAlertConfig,
nextScheduleTime,
predictInstanceSchemaUri,
samplePredictInstance,
satisfiesPzi,
satisfiesPzs,
scheduleState,
state,
statsAnomaliesBaseDirectory,
updateTime
FROM google.aiplatform.model_deployment_monitoring_jobs
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new model_deployment_monitoring_jobs resource.

/*+ create */
INSERT INTO google.aiplatform.model_deployment_monitoring_jobs (
locationsId,
projectsId,
logTtl,
statsAnomaliesBaseDirectory,
enableMonitoringPipelineLogs,
labels,
modelDeploymentMonitoringScheduleConfig,
encryptionSpec,
predictInstanceSchemaUri,
analysisInstanceSchemaUri,
modelDeploymentMonitoringObjectiveConfigs,
samplePredictInstance,
loggingSamplingStrategy,
displayName,
endpoint,
modelMonitoringAlertConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ logTtl }}',
'{{ statsAnomaliesBaseDirectory }}',
{{ enableMonitoringPipelineLogs }},
'{{ labels }}',
'{{ modelDeploymentMonitoringScheduleConfig }}',
'{{ encryptionSpec }}',
'{{ predictInstanceSchemaUri }}',
'{{ analysisInstanceSchemaUri }}',
'{{ modelDeploymentMonitoringObjectiveConfigs }}',
'{{ samplePredictInstance }}',
'{{ loggingSamplingStrategy }}',
'{{ displayName }}',
'{{ endpoint }}',
'{{ modelMonitoringAlertConfig }}'
;

UPDATE example

Updates a model_deployment_monitoring_jobs resource.

/*+ update */
UPDATE google.aiplatform.model_deployment_monitoring_jobs
SET
logTtl = '{{ logTtl }}',
statsAnomaliesBaseDirectory = '{{ statsAnomaliesBaseDirectory }}',
enableMonitoringPipelineLogs = true|false,
labels = '{{ labels }}',
modelDeploymentMonitoringScheduleConfig = '{{ modelDeploymentMonitoringScheduleConfig }}',
encryptionSpec = '{{ encryptionSpec }}',
predictInstanceSchemaUri = '{{ predictInstanceSchemaUri }}',
analysisInstanceSchemaUri = '{{ analysisInstanceSchemaUri }}',
modelDeploymentMonitoringObjectiveConfigs = '{{ modelDeploymentMonitoringObjectiveConfigs }}',
samplePredictInstance = '{{ samplePredictInstance }}',
loggingSamplingStrategy = '{{ loggingSamplingStrategy }}',
displayName = '{{ displayName }}',
endpoint = '{{ endpoint }}',
modelMonitoringAlertConfig = '{{ modelMonitoringAlertConfig }}'
WHERE
locationsId = '{{ locationsId }}'
AND modelDeploymentMonitoringJobsId = '{{ modelDeploymentMonitoringJobsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified model_deployment_monitoring_jobs resource.

/*+ delete */
DELETE FROM google.aiplatform.model_deployment_monitoring_jobs
WHERE locationsId = '{{ locationsId }}'
AND modelDeploymentMonitoringJobsId = '{{ modelDeploymentMonitoringJobsId }}'
AND projectsId = '{{ projectsId }}';