autoscaler_log.proto 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. // Copyright 2020 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.dataproc.logging;
  16. import "google/protobuf/duration.proto";
  17. option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/logging;logging";
  18. option java_multiple_files = true;
  19. option java_package = "com.google.cloud.dataproc.logging";
  20. // The short version of cluster configuration for Cloud logging.
  21. message ClusterSize {
  22. // The number of primary workers in the cluster.
  23. int32 primary_worker_count = 1;
  24. // The number of secondary workers in the cluster.
  25. int32 secondary_worker_count = 2;
  26. }
  27. // The main proto that will be converted to JSON format and then written to
  28. // Logging.
  29. message AutoscalerLog {
  30. // The current Autoscaler status.
  31. AutoscalerStatus status = 1;
  32. // Optional. The autoscaling recommendation including its inputs, outputs,
  33. // scaling decision, and detailed explanation.
  34. AutoscalerRecommendation recommendation = 2;
  35. }
  36. // The Autoscaler state.
  37. enum AutoscalerState {
  38. AUTOSCALER_STATE_UNSPECIFIED = 0;
  39. // The Autoscaler is sleeping and waiting for the next update.
  40. COOLDOWN = 1;
  41. // The Autoscaler is in the process of calculating its recommendation on
  42. // whether to scale the cluster, and if so, how to autoscale.
  43. RECOMMENDING = 6;
  44. // The Autoscaler is scaling the cluster.
  45. SCALING = 2;
  46. // The Autoscaler has stopped.
  47. STOPPED = 3;
  48. // The Autoscaler has failed.
  49. FAILED = 4;
  50. // The Autoscaler is initializing.
  51. INITIALIZING = 5;
  52. }
  53. // The Autoscaling decision type.
  54. enum ScalingDecisionType {
  55. SCALING_DECISION_TYPE_UNSPECIFIED = 0;
  56. // Increase the number of primary and/or secondary workers.
  57. SCALE_UP = 1;
  58. // Decrease the number of primary and/or secondary workers.
  59. SCALE_DOWN = 2;
  60. // Not changing the number of primary or secondary workers.
  61. NO_SCALE = 3;
  62. // Scale the primary and secondary worker groups in different directions.
  63. MIXED = 4;
  64. }
  65. enum ConstrainingFactor {
  66. CONSTRAINING_FACTOR_UNSPECIFIED = 0;
  67. // The project does not have sufficient regional, global, and or preemptible
  68. // quota to allocate a new VM.
  69. SCALING_CAPPED_DUE_TO_LACK_OF_QUOTA = 1;
  70. // All worker groups have reached maximum size. This message will not be
  71. // issued if one group reached maximum size, but workers were able to be
  72. // allocated to another group.
  73. REACHED_MAXIMUM_CLUSTER_SIZE = 2;
  74. // All worker groups have reached minimum size. This message will not be
  75. // issued if workers were able to be removed from another group that had not
  76. // reached minimum size.
  77. REACHED_MINIMUM_CLUSTER_SIZE = 3;
  78. }
  79. // The Autoscaler's status, including its state and other details.
  80. message AutoscalerStatus {
  81. // The high-level Autoscaler state.
  82. AutoscalerState state = 1;
  83. // The detailed description of Autoscaler status.
  84. string details = 2;
  85. // The cluster update operation ID.
  86. string update_cluster_operation_id = 3;
  87. // Error message from an Autoscaler exception, if any.
  88. string error = 4;
  89. }
  90. // The inputs, outputs, and detailed explanation of the Autoscaling
  91. // recommendation.
  92. message AutoscalerRecommendation {
  93. // The input values for the Autoscaling recommendation alogirthm.
  94. message Inputs {
  95. // The metrics collected by the Dataproc agent running on the cluster.
  96. // For example, {"avg-yarn-pending-memory": "1040 MB"}
  97. map<string, string> cluster_metrics = 1;
  98. // The cluster configuration before updating the cluster.
  99. ClusterSize current_cluster_size = 2;
  100. // The minimum worker counts for each instance group.
  101. ClusterSize min_worker_counts = 3;
  102. // The maximum worker counts for each instance group.
  103. ClusterSize max_worker_counts = 4;
  104. }
  105. // Autoscaler recommendations.
  106. message Outputs {
  107. // The high-level autoscaling decision, such as SCALE_UP, SCALE_DOWN,
  108. // NO_OP.
  109. ScalingDecisionType decision = 1;
  110. // The recommended cluster size.
  111. ClusterSize recommended_cluster_size = 2;
  112. // The graceful decommission timeout for downscaling operations.
  113. google.protobuf.Duration graceful_decommission_timeout = 3;
  114. // Reasons why the Autoscaler didn't add or remove more workers.
  115. repeated ConstrainingFactor constraints_reached = 4;
  116. // Less significant recommendations that are not included in the
  117. // `AutoscalerStatus.details` message.
  118. repeated string additional_recommendation_details = 5;
  119. // A unique id for this recommendation that should be included when opening
  120. // a support ticket.
  121. string recommendation_id = 6;
  122. }
  123. // The autoscaling algorithm inputs.
  124. Inputs inputs = 1;
  125. // The algorithm outputs for the recommended cluster size.
  126. Outputs outputs = 2;
  127. }