featurestore_monitoring.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. syntax = "proto3";
  15. package google.cloud.aiplatform.v1;
  16. option csharp_namespace = "Google.Cloud.AIPlatform.V1";
  17. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "FeaturestoreMonitoringProto";
  20. option java_package = "com.google.cloud.aiplatform.v1";
  21. option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
  22. option ruby_package = "Google::Cloud::AIPlatform::V1";
  23. // Configuration of how features in Featurestore are monitored.
  24. message FeaturestoreMonitoringConfig {
  25. // Configuration of the Featurestore's Snapshot Analysis Based Monitoring.
  26. // This type of analysis generates statistics for each Feature based on a
  27. // snapshot of the latest feature value of each entities every
  28. // monitoring_interval.
  29. message SnapshotAnalysis {
  30. // The monitoring schedule for snapshot analysis.
  31. // For EntityType-level config:
  32. // unset / disabled = true indicates disabled by
  33. // default for Features under it; otherwise by default enable snapshot
  34. // analysis monitoring with monitoring_interval for Features under it.
  35. // Feature-level config:
  36. // disabled = true indicates disabled regardless of the EntityType-level
  37. // config; unset monitoring_interval indicates going with EntityType-level
  38. // config; otherwise run snapshot analysis monitoring with
  39. // monitoring_interval regardless of the EntityType-level config.
  40. // Explicitly Disable the snapshot analysis based monitoring.
  41. bool disabled = 1;
  42. // Configuration of the snapshot analysis based monitoring pipeline
  43. // running interval. The value indicates number of days.
  44. // If both
  45. // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days]
  46. // and [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval][]
  47. // are set when creating/updating EntityTypes/Features,
  48. // [FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days][google.cloud.aiplatform.v1.FeaturestoreMonitoringConfig.SnapshotAnalysis.monitoring_interval_days]
  49. // will be used.
  50. int32 monitoring_interval_days = 3;
  51. // Customized export features time window for snapshot analysis. Unit is one
  52. // day. Default value is 3 weeks. Minimum value is 1 day. Maximum value is
  53. // 4000 days.
  54. int32 staleness_days = 4;
  55. }
  56. // Configuration of the Featurestore's ImportFeature Analysis Based
  57. // Monitoring. This type of analysis generates statistics for values of each
  58. // Feature imported by every [ImportFeatureValues][] operation.
  59. message ImportFeaturesAnalysis {
  60. // The state defines whether to enable ImportFeature analysis.
  61. enum State {
  62. // Should not be used.
  63. STATE_UNSPECIFIED = 0;
  64. // The default behavior of whether to enable the monitoring.
  65. // EntityType-level config: disabled.
  66. // Feature-level config: inherited from the configuration of EntityType
  67. // this Feature belongs to.
  68. DEFAULT = 1;
  69. // Explicitly enables import features analysis.
  70. // EntityType-level config: by default enables import features analysis
  71. // for all Features under it. Feature-level config: enables import
  72. // features analysis regardless of the EntityType-level config.
  73. ENABLED = 2;
  74. // Explicitly disables import features analysis.
  75. // EntityType-level config: by default disables import features analysis
  76. // for all Features under it. Feature-level config: disables import
  77. // features analysis regardless of the EntityType-level config.
  78. DISABLED = 3;
  79. }
  80. // Defines the baseline to do anomaly detection for feature values imported
  81. // by each [ImportFeatureValues][] operation.
  82. enum Baseline {
  83. // Should not be used.
  84. BASELINE_UNSPECIFIED = 0;
  85. // Choose the later one statistics generated by either most recent
  86. // snapshot analysis or previous import features analysis. If non of them
  87. // exists, skip anomaly detection and only generate a statistics.
  88. LATEST_STATS = 1;
  89. // Use the statistics generated by the most recent snapshot analysis if
  90. // exists.
  91. MOST_RECENT_SNAPSHOT_STATS = 2;
  92. // Use the statistics generated by the previous import features analysis
  93. // if exists.
  94. PREVIOUS_IMPORT_FEATURES_STATS = 3;
  95. }
  96. // Whether to enable / disable / inherite default hebavior for import
  97. // features analysis.
  98. State state = 1;
  99. // The baseline used to do anomaly detection for the statistics generated by
  100. // import features analysis.
  101. Baseline anomaly_detection_baseline = 2;
  102. }
  103. // The config for Featurestore Monitoring threshold.
  104. message ThresholdConfig {
  105. oneof threshold {
  106. // Specify a threshold value that can trigger the alert.
  107. // 1. For categorical feature, the distribution distance is calculated by
  108. // L-inifinity norm.
  109. // 2. For numerical feature, the distribution distance is calculated by
  110. // Jensen–Shannon divergence. Each feature must have a non-zero threshold
  111. // if they need to be monitored. Otherwise no alert will be triggered for
  112. // that feature.
  113. double value = 1;
  114. }
  115. }
  116. // The config for Snapshot Analysis Based Feature Monitoring.
  117. SnapshotAnalysis snapshot_analysis = 1;
  118. // The config for ImportFeatures Analysis Based Feature Monitoring.
  119. ImportFeaturesAnalysis import_features_analysis = 2;
  120. // Threshold for numerical features of anomaly detection.
  121. // This is shared by all objectives of Featurestore Monitoring for numerical
  122. // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) DOUBLE or INT64).
  123. ThresholdConfig numerical_threshold_config = 3;
  124. // Threshold for categorical features of anomaly detection.
  125. // This is shared by all types of Featurestore Monitoring for categorical
  126. // features (i.e. Features with type ([Feature.ValueType][google.cloud.aiplatform.v1.Feature.ValueType]) BOOL or STRING).
  127. ThresholdConfig categorical_threshold_config = 4;
  128. }