1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.aiplatform.v1beta1; 18 19import "google/protobuf/duration.proto"; 20 21option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; 22option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; 23option java_multiple_files = true; 24option java_outer_classname = "FeaturestoreMonitoringProto"; 25option java_package = "com.google.cloud.aiplatform.v1beta1"; 26option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; 27option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; 28 29// Configuration of how features in Featurestore are monitored. 30message FeaturestoreMonitoringConfig { 31 // Configuration of the Featurestore's Snapshot Analysis Based Monitoring. 32 // This type of analysis generates statistics for each Feature based on a 33 // snapshot of the latest feature value of each entities every 34 // monitoring_interval. 35 message SnapshotAnalysis { 36 // The monitoring schedule for snapshot analysis. 37 // For EntityType-level config: 38 // unset / disabled = true indicates disabled by 39 // default for Features under it; otherwise by default enable snapshot 40 // analysis monitoring with monitoring_interval for Features under it. 41 // Feature-level config: 42 // disabled = true indicates disabled regardless of the EntityType-level 43 // config; unset monitoring_interval indicates going with EntityType-level 44 // config; otherwise run snapshot analysis monitoring with 45 // monitoring_interval regardless of the EntityType-level config. 46 // Explicitly Disable the snapshot analysis based monitoring. 47 bool disabled = 1; 48 49 // Configuration of the snapshot analysis based monitoring pipeline running 50 // interval. The value is rolled up to full day. 51 // If both 52 // [monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] 53 // and the deprecated `monitoring_interval` field 54 // are set when creating/updating EntityTypes/Features, 55 // [monitoring_interval_days][google.cloud.aiplatform.v1beta1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days] 56 // will be used. 57 google.protobuf.Duration monitoring_interval = 2 [deprecated = true]; 58 59 // Configuration of the snapshot analysis based monitoring pipeline 60 // running interval. The value indicates number of days. 61 int32 monitoring_interval_days = 3; 62 63 // Customized export features time window for snapshot analysis. Unit is one 64 // day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is 65 // 4000 days. 66 int32 staleness_days = 4; 67 } 68 69 // Configuration of the Featurestore's ImportFeature Analysis Based 70 // Monitoring. This type of analysis generates statistics for values of each 71 // Feature imported by every 72 // [ImportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ImportFeatureValues] 73 // operation. 74 message ImportFeaturesAnalysis { 75 // The state defines whether to enable ImportFeature analysis. 76 enum State { 77 // Should not be used. 78 STATE_UNSPECIFIED = 0; 79 80 // The default behavior of whether to enable the monitoring. 81 // EntityType-level config: disabled. 82 // Feature-level config: inherited from the configuration of EntityType 83 // this Feature belongs to. 84 DEFAULT = 1; 85 86 // Explicitly enables import features analysis. 87 // EntityType-level config: by default enables import features analysis 88 // for all Features under it. Feature-level config: enables import 89 // features analysis regardless of the EntityType-level config. 90 ENABLED = 2; 91 92 // Explicitly disables import features analysis. 93 // EntityType-level config: by default disables import features analysis 94 // for all Features under it. Feature-level config: disables import 95 // features analysis regardless of the EntityType-level config. 96 DISABLED = 3; 97 } 98 99 // Defines the baseline to do anomaly detection for feature values imported 100 // by each 101 // [ImportFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreService.ImportFeatureValues] 102 // operation. 103 enum Baseline { 104 // Should not be used. 105 BASELINE_UNSPECIFIED = 0; 106 107 // Choose the later one statistics generated by either most recent 108 // snapshot analysis or previous import features analysis. If non of them 109 // exists, skip anomaly detection and only generate a statistics. 110 LATEST_STATS = 1; 111 112 // Use the statistics generated by the most recent snapshot analysis if 113 // exists. 114 MOST_RECENT_SNAPSHOT_STATS = 2; 115 116 // Use the statistics generated by the previous import features analysis 117 // if exists. 118 PREVIOUS_IMPORT_FEATURES_STATS = 3; 119 } 120 121 // Whether to enable / disable / inherite default hebavior for import 122 // features analysis. 123 State state = 1; 124 125 // The baseline used to do anomaly detection for the statistics generated by 126 // import features analysis. 127 Baseline anomaly_detection_baseline = 2; 128 } 129 130 // The config for Featurestore Monitoring threshold. 131 message ThresholdConfig { 132 oneof threshold { 133 // Specify a threshold value that can trigger the alert. 134 // 1. For categorical feature, the distribution distance is calculated by 135 // L-inifinity norm. 136 // 2. For numerical feature, the distribution distance is calculated by 137 // Jensen–Shannon divergence. Each feature must have a non-zero threshold 138 // if they need to be monitored. Otherwise no alert will be triggered for 139 // that feature. 140 double value = 1; 141 } 142 } 143 144 // The config for Snapshot Analysis Based Feature Monitoring. 145 SnapshotAnalysis snapshot_analysis = 1; 146 147 // The config for ImportFeatures Analysis Based Feature Monitoring. 148 ImportFeaturesAnalysis import_features_analysis = 2; 149 150 // Threshold for numerical features of anomaly detection. 151 // This is shared by all objectives of Featurestore Monitoring for numerical 152 // features (i.e. Features with type 153 // ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) 154 // DOUBLE or INT64). 155 ThresholdConfig numerical_threshold_config = 3; 156 157 // Threshold for categorical features of anomaly detection. 158 // This is shared by all types of Featurestore Monitoring for categorical 159 // features (i.e. Features with type 160 // ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType]) 161 // BOOL or STRING). 162 ThresholdConfig categorical_threshold_config = 4; 163} 164