Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vertexai): Add fields to Vertex AI FeatureStore EntityType for Feature Value Monitoring #6699

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion mmv1/products/vertexai/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ objects:
- !ruby/object:Api::Type::NestedObject
name: 'snapshotAnalysis'
description: |
Configuration of how features in Featurestore are monitored.
The config for Snapshot Analysis Based Feature Monitoring.
properties:
- !ruby/object:Api::Type::Boolean
name: 'disabled'
Expand All @@ -277,6 +277,57 @@ objects:
Configuration of the snapshot analysis based monitoring pipeline running interval. The value is rolled up to full day.

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
- !ruby/object:Api::Type::Integer
name: 'monitoringIntervalDays'
description: |
Configuration of the snapshot analysis based monitoring pipeline running interval. The value indicates number of days. The default value is 1.
If both FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][] are set when creating/updating EntityTypes/Features, FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days will be used.
default_value: 1
- !ruby/object:Api::Type::Integer
name: 'stalenessDays'
description: |
Customized export features time window for snapshot analysis. Unit is one day. The default value is 21 days. Minimum value is 1 day. Maximum value is 4000 days.
default_value: 21
- !ruby/object:Api::Type::NestedObject
name: 'importFeaturesAnalysis'
description: |
The config for ImportFeatures Analysis Based Feature Monitoring.
properties:
- !ruby/object:Api::Type::String
name: state
description: |
Whether to enable / disable / inherite default hebavior for import features analysis. The value must be one of the values below:
* DEFAULT: The default behavior of whether to enable the monitoring. EntityType-level config: disabled.
* ENABLED: Explicitly enables import features analysis. EntityType-level config: by default enables import features analysis for all Features under it.
* DISABLED: Explicitly disables import features analysis. EntityType-level config: by default disables import features analysis for all Features under it.
- !ruby/object:Api::Type::String
name: 'anomalyDetectionBaseline'
description: |
Defines the baseline to do anomaly detection for feature values imported by each [entityTypes.importFeatureValues][] operation. The value must be one of the values below:
* LATEST_STATS: Choose the later one statistics generated by either most recent snapshot analysis or previous import features analysis. If non of them exists, skip anomaly detection and only generate a statistics.
* MOST_RECENT_SNAPSHOT_STATS: Use the statistics generated by the most recent snapshot analysis if exists.
* PREVIOUS_IMPORT_FEATURES_STATS: Use the statistics generated by the previous import features analysis if exists.
- !ruby/object:Api::Type::NestedObject
name: 'numericalThresholdConfig'
description: |
Threshold for numerical features of anomaly detection. This is shared by all objectives of Featurestore Monitoring for numerical features (i.e. Features with type (Feature.ValueType) DOUBLE or INT64).
properties:
- !ruby/object:Api::Type::Double
name: 'value'
description: |
Specify a threshold value that can trigger the alert. For numerical feature, the distribution distance is calculated by Jensen–Shannon divergence. Each feature must have a non-zero threshold if they need to be monitored. Otherwise no alert will be triggered for that feature. The default value is 0.3.
required: true
- !ruby/object:Api::Type::NestedObject
name: 'categoricalThresholdConfig'
description: |
Threshold for categorical features of anomaly detection. This is shared by all types of Featurestore Monitoring for categorical features (i.e. Features with type (Feature.ValueType) BOOL or STRING).
properties:
- !ruby/object:Api::Type::Double
name: 'value'
description: |
Specify a threshold value that can trigger the alert. For categorical feature, the distribution distance is calculated by L-inifinity norm. Each feature must have a non-zero threshold if they need to be monitored. Otherwise no alert will be triggered for that feature. The default value is 0.3.
required: true


# Vertex AI Featurestore Entity Type Feature
- !ruby/object:Api::Resource
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/vertexai/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides
ignore_read: true
name: !ruby/object:Overrides::Terraform::PropertyOverride
custom_flatten: templates/terraform/custom_flatten/name_from_self_link.erb
monitoringConfig.snapshotAnalysis.monitoringInterval: !ruby/object:Overrides::Terraform::PropertyOverride
default_from_api: true
megan07 marked this conversation as resolved.
Show resolved Hide resolved
custom_code: !ruby/object:Provider::Terraform::CustomCode
pre_create: templates/terraform/constants/vertex_ai_featurestore_entitytype.go.erb
pre_update: templates/terraform/constants/vertex_ai_featurestore_entitytype.go.erb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,21 @@ resource "google_vertex_ai_featurestore_entitytype" "entity" {
foo = "bar"
}
featurestore = google_vertex_ai_featurestore.featurestore.id
monitoring_config {
snapshot_analysis {
disabled = false
monitoring_interval_days = 1
staleness_days = 21
}
numerical_threshold_config {
value = 0.8
}
categorical_threshold_config {
value = 10.0
}
import_features_analysis {
state = "ENABLED"
anomaly_detection_baseline = "PREVIOUS_IMPORT_FEATURES_STATS"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ resource "google_vertex_ai_featurestore_entitytype" "entity" {
disabled = false
monitoring_interval = "86400s"
}

categorical_threshold_config {
value = 0.3
}

numerical_threshold_config {
value = 0.3
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ resource "google_vertex_ai_featurestore_entitytype" "entity" {
disabled = false
monitoring_interval = "86400s"
}

categorical_threshold_config {
value = 0.3
}

numerical_threshold_config {
value = 0.3
}
}
}