Skip to content

Commit 90f38d1

Browse files
Google APIscopybara-github
authored andcommitted
feat: add monitoring_config to EntityType in aiplatform v1 entity_type.proto
feat: add disable_monitoring to Feature in aiplatform v1 feature.proto feat: add monitoring_stats_anomalies to Feature in aiplatform v1 feature.proto feat: add staleness_days to SnapshotAnalysis in aiplatform v1 featurestore_monitoring.proto feat: add import_features_analysis to FeaturestoreMonitoringConfig in aiplatform v1 featurestore_monitoring.proto feat: add numerical_threshold_config to FeaturestoreMonitoringConfig in aiplatform v1 featurestore_monitoring.proto feat: add categorical_threshold_config to FeaturestoreMonitoringConfig in aiplatform v1 featurestore_monitoring.proto feat: add objective to MonitoringStatsSpec in aiplatform v1 featurestore_service.proto feat: add disable_monitoring to Feature in aiplatform v1beta1 feature.proto feat: add monitoring_stats_anomalies to Feature in aiplatform v1beta1 feature.proto feat: add staleness_days to SnapshotAnalysis in aiplatform v1beta1 featurestore_monitoring.proto feat: add import_features_analysis to FeaturestoreMonitoringConfig in aiplatform v1beta1 featurestore_monitoring.proto feat: add numerical_threshold_config to FeaturestoreMonitoringConfig in aiplatform v1beta1 featurestore_monitoring.proto feat: add categorical_threshold_config to FeaturestoreMonitoringConfig in aiplatform v1beta1 featurestore_monitoring.proto feat: add objective to MonitoringStatsSpec in aiplatform v1beta1 featurestore_service.proto PiperOrigin-RevId: 434018027
1 parent cb5b02f commit 90f38d1

8 files changed

Lines changed: 371 additions & 7 deletions

File tree

google/cloud/aiplatform/v1/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ proto_library(
5252
"explanation.proto",
5353
"explanation_metadata.proto",
5454
"feature.proto",
55+
"featurestore_monitoring.proto",
5556
"feature_monitoring_stats.proto",
5657
"feature_selector.proto",
5758
"featurestore.proto",

google/cloud/aiplatform/v1/entity_type.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/cloud/aiplatform/v1/featurestore_monitoring.proto";
2122
import "google/protobuf/timestamp.proto";
2223

2324
option csharp_namespace = "Google.Cloud.AIPlatform.V1";
@@ -72,4 +73,16 @@ message EntityType {
7273
// Optional. Used to perform a consistent read-modify-write updates. If not set, a blind
7374
// "overwrite" update happens.
7475
string etag = 7 [(google.api.field_behavior) = OPTIONAL];
76+
77+
// Optional. The default monitoring configuration for all Features with value
78+
// type
79+
// ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL,
80+
// STRING, DOUBLE or INT64 under this EntityType.
81+
//
82+
// If this is populated with
83+
// [FeaturestoreMonitoringConfig.monitoring_interval] specified, snapshot
84+
// analysis monitoring is enabled. Otherwise, snapshot analysis monitoring is
85+
// disabled.
86+
FeaturestoreMonitoringConfig monitoring_config = 8
87+
[(google.api.field_behavior) = OPTIONAL];
7588
}

google/cloud/aiplatform/v1/feature.proto

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/cloud/aiplatform/v1/feature_monitoring_stats.proto";
2122
import "google/protobuf/timestamp.proto";
2223

2324
option csharp_namespace = "Google.Cloud.AIPlatform.V1";
@@ -37,6 +38,36 @@ message Feature {
3738
pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}"
3839
};
3940

41+
// A list of historical [Snapshot
42+
// Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] or [Import Feature
43+
// Analysis] [FeaturestoreMonitoringConfig.ImportFeatureAnalysis] stats
44+
// requested by user, sorted by
45+
// [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1.FeatureStatsAnomaly.start_time]
46+
// descending.
47+
message MonitoringStatsAnomaly {
48+
// If the objective in the request is both
49+
// Import Feature Analysis and Snapshot Analysis, this objective could be
50+
// one of them. Otherwise, this objective should be the same as the
51+
// objective in the request.
52+
enum Objective {
53+
// If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty.
54+
OBJECTIVE_UNSPECIFIED = 0;
55+
56+
// Stats are generated by Import Feature Analysis.
57+
IMPORT_FEATURE_ANALYSIS = 1;
58+
59+
// Stats are generated by Snapshot Analysis.
60+
SNAPSHOT_ANALYSIS = 2;
61+
}
62+
63+
// Output only. The objective for each stats.
64+
Objective objective = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
65+
66+
// Output only. The stats and anomalies generated at specific timestamp.
67+
FeatureStatsAnomaly feature_stats_anomaly = 2
68+
[(google.api.field_behavior) = OUTPUT_ONLY];
69+
}
70+
4071
// An enum representing the value type of a feature.
4172
enum ValueType {
4273
// The value type is unspecified.
@@ -111,4 +142,18 @@ message Feature {
111142
// Used to perform a consistent read-modify-write updates. If not set, a blind
112143
// "overwrite" update happens.
113144
string etag = 7;
145+
146+
// Optional. If not set, use the monitoring_config defined for the EntityType
147+
// this Feature belongs to. Only Features with type
148+
// ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL,
149+
// STRING, DOUBLE or INT64 can enable monitoring.
150+
//
151+
// If set to true, all types of data monitoring are disabled despite the
152+
// config on EntityType.
153+
bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL];
154+
155+
// Output only. The list of historical stats and anomalies with specified
156+
// objectives.
157+
repeated MonitoringStatsAnomaly monitoring_stats_anomalies = 11
158+
[(google.api.field_behavior) = OUTPUT_ONLY];
114159
}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
// Copyright 2022 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.aiplatform.v1;
18+
19+
option csharp_namespace = "Google.Cloud.AIPlatform.V1";
20+
option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform";
21+
option java_multiple_files = true;
22+
option java_outer_classname = "FeaturestoreMonitoringProto";
23+
option java_package = "com.google.cloud.aiplatform.v1";
24+
option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
25+
option ruby_package = "Google::Cloud::AIPlatform::V1";
26+
27+
// Configuration of how features in Featurestore are monitored.
28+
message FeaturestoreMonitoringConfig {
29+
// Configuration of the Featurestore's Snapshot Analysis Based Monitoring.
30+
// This type of analysis generates statistics for each Feature based on a
31+
// snapshot of the latest feature value of each entities every
32+
// monitoring_interval.
33+
message SnapshotAnalysis {
34+
// The monitoring schedule for snapshot analysis.
35+
// For EntityType-level config:
36+
// unset / disabled = true indicates disabled by
37+
// default for Features under it; otherwise by default enable snapshot
38+
// analysis monitoring with monitoring_interval for Features under it.
39+
// Feature-level config:
40+
// disabled = true indicates disabled regardless of the EntityType-level
41+
// config; unset monitoring_interval indicates going with EntityType-level
42+
// config; otherwise run snapshot analysis monitoring with
43+
// monitoring_interval regardless of the EntityType-level config.
44+
// Explicitly Disable the snapshot analysis based monitoring.
45+
bool disabled = 1;
46+
47+
// Configuration of the snapshot analysis based monitoring pipeline
48+
// running interval. The value indicates number of days.
49+
// If both
50+
// [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days]
51+
// and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][]
52+
// are set when creating/updating EntityTypes/Features,
53+
// [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days]
54+
// will be used.
55+
int32 monitoring_interval_days = 3;
56+
57+
// Customized export features time window for snapshot analysis. Unit is one
58+
// day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is
59+
// 4000 days.
60+
int32 staleness_days = 4;
61+
}
62+
63+
// Configuration of the Featurestore's ImportFeature Analysis Based
64+
// Monitoring. This type of analysis generates statistics for values of each
65+
// Feature imported by every [ImportFeatureValues][] operation.
66+
message ImportFeaturesAnalysis {
67+
// The state defines whether to enable ImportFeature analysis.
68+
enum State {
69+
// Should not be used.
70+
STATE_UNSPECIFIED = 0;
71+
72+
// The default behavior of whether to enable the monitoring.
73+
// EntityType-level config: disabled.
74+
// Feature-level config: inherited from the configuration of EntityType
75+
// this Feature belongs to.
76+
DEFAULT = 1;
77+
78+
// Explicitly enables import features analysis.
79+
// EntityType-level config: by default enables import features analysis
80+
// for all Features under it. Feature-level config: enables import
81+
// features analysis regardless of the EntityType-level config.
82+
ENABLED = 2;
83+
84+
// Explicitly disables import features analysis.
85+
// EntityType-level config: by default disables import features analysis
86+
// for all Features under it. Feature-level config: disables import
87+
// features analysis regardless of the EntityType-level config.
88+
DISABLED = 3;
89+
}
90+
91+
// Defines the baseline to do anomaly detection for feature values imported
92+
// by each [ImportFeatureValues][] operation.
93+
enum Baseline {
94+
// Should not be used.
95+
BASELINE_UNSPECIFIED = 0;
96+
97+
// Choose the later one statistics generated by either most recent
98+
// snapshot analysis or previous import features analysis. If non of them
99+
// exists, skip anomaly detection and only generate a statistics.
100+
LATEST_STATS = 1;
101+
102+
// Use the statistics generated by the most recent snapshot analysis if
103+
// exists.
104+
MOST_RECENT_SNAPSHOT_STATS = 2;
105+
106+
// Use the statistics generated by the previous import features analysis
107+
// if exists.
108+
PREVIOUS_IMPORT_FEATURES_STATS = 3;
109+
}
110+
111+
// Whether to enable / disable / inherite default hebavior for import
112+
// features analysis.
113+
State state = 1;
114+
115+
// The baseline used to do anomaly detection for the statistics generated by
116+
// import features analysis.
117+
Baseline anomaly_detection_baseline = 2;
118+
}
119+
120+
// The config for Featurestore Monitoring threshold.
121+
message ThresholdConfig {
122+
oneof threshold {
123+
// Specify a threshold value that can trigger the alert.
124+
// 1. For categorical feature, the distribution distance is calculated by
125+
// L-inifinity norm.
126+
// 2. For numerical feature, the distribution distance is calculated by
127+
// Jensen–Shannon divergence. Each feature must have a non-zero threshold
128+
// if they need to be monitored. Otherwise no alert will be triggered for
129+
// that feature.
130+
double value = 1;
131+
}
132+
}
133+
134+
// The config for Snapshot Analysis Based Feature Monitoring.
135+
SnapshotAnalysis snapshot_analysis = 1;
136+
137+
// The config for ImportFeatures Analysis Based Feature Monitoring.
138+
ImportFeaturesAnalysis import_features_analysis = 2;
139+
140+
// Threshold for numerical features of anomaly detection.
141+
// This is shared by all objectives of Featurestore Monitoring for numerical
142+
// features (i.e. Features with type
143+
// ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) DOUBLE
144+
// or INT64).
145+
ThresholdConfig numerical_threshold_config = 3;
146+
147+
// Threshold for categorical features of anomaly detection.
148+
// This is shared by all types of Featurestore Monitoring for categorical
149+
// features (i.e. Features with type
150+
// ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL or
151+
// STRING).
152+
ThresholdConfig categorical_threshold_config = 4;
153+
}

google/cloud/aiplatform/v1/featurestore_service.proto

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ message ImportFeatureValuesRequest {
505505
// If not set, defaults to using 1 worker. The low count ensures minimal
506506
// impact on online serving performance.
507507
int32 worker_count = 11;
508+
509+
// If true, API doesn't start ingestion analysis pipeline.
510+
bool disable_ingestion_analysis = 12;
508511
}
509512

510513
// Response message for [FeaturestoreService.ImportFeatureValues][google.cloud.aiplatform.v1.FeaturestoreService.ImportFeatureValues].
@@ -846,7 +849,12 @@ message UpdateEntityTypeRequest {
846849
// * `description`
847850
// * `labels`
848851
// * `monitoring_config.snapshot_analysis.disabled`
849-
// * `monitoring_config.snapshot_analysis.monitoring_interval`
852+
// * `monitoring_config.snapshot_analysis.monitoring_interval_days`
853+
// * `monitoring_config.snapshot_analysis.staleness_days`
854+
// * `monitoring_config.import_features_analysis.state`
855+
// * `monitoring_config.import_features_analysis.anomaly_detection_baseline`
856+
// * `monitoring_config.numerical_threshold_config.value`
857+
// * `monitoring_config.categorical_threshold_config.value`
850858
google.protobuf.FieldMask update_mask = 2;
851859
}
852860

@@ -1138,8 +1146,7 @@ message UpdateFeatureRequest {
11381146
//
11391147
// * `description`
11401148
// * `labels`
1141-
// * `monitoring_config.snapshot_analysis.disabled`
1142-
// * `monitoring_config.snapshot_analysis.monitoring_interval`
1149+
// * `disable_monitoring`
11431150
google.protobuf.FieldMask update_mask = 2;
11441151
}
11451152

google/cloud/aiplatform/v1beta1/feature.proto

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,36 @@ message Feature {
4040
pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}"
4141
};
4242

43+
// A list of historical [Snapshot
44+
// Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis] or [Import Feature
45+
// Analysis] [FeaturestoreMonitoringConfig.ImportFeatureAnalysis] stats
46+
// requested by user, sorted by
47+
// [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time]
48+
// descending.
49+
message MonitoringStatsAnomaly {
50+
// If the objective in the request is both
51+
// Import Feature Analysis and Snapshot Analysis, this objective could be
52+
// one of them. Otherwise, this objective should be the same as the
53+
// objective in the request.
54+
enum Objective {
55+
// If it's OBJECTIVE_UNSPECIFIED, monitoring_stats will be empty.
56+
OBJECTIVE_UNSPECIFIED = 0;
57+
58+
// Stats are generated by Import Feature Analysis.
59+
IMPORT_FEATURE_ANALYSIS = 1;
60+
61+
// Stats are generated by Snapshot Analysis.
62+
SNAPSHOT_ANALYSIS = 2;
63+
}
64+
65+
// Output only. The objective for each stats.
66+
Objective objective = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
67+
68+
// Output only. The stats and anomalies generated at specific timestamp.
69+
FeatureStatsAnomaly feature_stats_anomaly = 2
70+
[(google.api.field_behavior) = OUTPUT_ONLY];
71+
}
72+
4373
// An enum representing the value type of a feature.
4474
enum ValueType {
4575
// The value type is unspecified.
@@ -128,9 +158,23 @@ message Feature {
128158
// config is same as the EntityType's this Feature belongs to.
129159
FeaturestoreMonitoringConfig monitoring_config = 9 [(google.api.field_behavior) = OPTIONAL];
130160

161+
// Optional. If not set, use the monitoring_config defined for the EntityType
162+
// this Feature belongs to. Only Features with type
163+
// ([Feature.ValueType][google.cloud.aiplatform.v1beta1.Feature.ValueType])
164+
// BOOL, STRING, DOUBLE or INT64 can enable monitoring.
165+
//
166+
// If set to true, all types of data monitoring are disabled despite the
167+
// config on EntityType.
168+
bool disable_monitoring = 12 [(google.api.field_behavior) = OPTIONAL];
169+
131170
// Output only. A list of historical [Snapshot
132171
// Analysis][FeaturestoreMonitoringConfig.SnapshotAnalysis]
133172
// stats requested by user, sorted by [FeatureStatsAnomaly.start_time][google.cloud.aiplatform.v1beta1.FeatureStatsAnomaly.start_time]
134173
// descending.
135174
repeated FeatureStatsAnomaly monitoring_stats = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
175+
176+
// Output only. The list of historical stats and anomalies with specified
177+
// objectives.
178+
repeated MonitoringStatsAnomaly monitoring_stats_anomalies = 11
179+
[(google.api.field_behavior) = OUTPUT_ONLY];
136180
}

0 commit comments

Comments
 (0)