metric_value.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Copyright 2021 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.api.servicecontrol.v1;
  16. import "google/api/servicecontrol/v1/distribution.proto";
  17. import "google/protobuf/timestamp.proto";
  18. option cc_enable_arenas = true;
  19. option csharp_namespace = "Google.Cloud.ServiceControl.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/api/servicecontrol/v1;servicecontrol";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "MetricValueSetProto";
  23. option java_package = "com.google.api.servicecontrol.v1";
  24. option php_namespace = "Google\\Cloud\\ServiceControl\\V1";
  25. option ruby_package = "Google::Cloud::ServiceControl::V1";
  26. // Represents a single metric value.
  27. message MetricValue {
  28. // The labels describing the metric value.
  29. // See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
  30. // the overriding relationship.
  31. // Note that this map must not contain monitored resource labels.
  32. map<string, string> labels = 1;
  33. // The start of the time period over which this metric value's measurement
  34. // applies. The time period has different semantics for different metric
  35. // types (cumulative, delta, and gauge). See the metric definition
  36. // documentation in the service configuration for details. If not specified,
  37. // [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
  38. google.protobuf.Timestamp start_time = 2;
  39. // The end of the time period over which this metric value's measurement
  40. // applies. If not specified,
  41. // [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
  42. google.protobuf.Timestamp end_time = 3;
  43. // The value. The type of value used in the request must
  44. // agree with the metric definition in the service configuration, otherwise
  45. // the MetricValue is rejected.
  46. oneof value {
  47. // A boolean value.
  48. bool bool_value = 4;
  49. // A signed 64-bit integer value.
  50. int64 int64_value = 5;
  51. // A double precision floating point value.
  52. double double_value = 6;
  53. // A text string value.
  54. string string_value = 7;
  55. // A distribution value.
  56. Distribution distribution_value = 8;
  57. }
  58. }
  59. // Represents a set of metric values in the same metric.
  60. // Each metric value in the set should have a unique combination of start time,
  61. // end time, and label values.
  62. message MetricValueSet {
  63. // The metric name defined in the service configuration.
  64. string metric_name = 1;
  65. // The values in this metric.
  66. repeated MetricValue metric_values = 2;
  67. }