monitoring.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Copyright 2023 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;
  16. option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "MonitoringProto";
  19. option java_package = "com.google.api";
  20. option objc_class_prefix = "GAPI";
  21. // Monitoring configuration of the service.
  22. //
  23. // The example below shows how to configure monitored resources and metrics
  24. // for monitoring. In the example, a monitored resource and two metrics are
  25. // defined. The `library.googleapis.com/book/returned_count` metric is sent
  26. // to both producer and consumer projects, whereas the
  27. // `library.googleapis.com/book/num_overdue` metric is only sent to the
  28. // consumer project.
  29. //
  30. // monitored_resources:
  31. // - type: library.googleapis.com/Branch
  32. // display_name: "Library Branch"
  33. // description: "A branch of a library."
  34. // launch_stage: GA
  35. // labels:
  36. // - key: resource_container
  37. // description: "The Cloud container (ie. project id) for the Branch."
  38. // - key: location
  39. // description: "The location of the library branch."
  40. // - key: branch_id
  41. // description: "The id of the branch."
  42. // metrics:
  43. // - name: library.googleapis.com/book/returned_count
  44. // display_name: "Books Returned"
  45. // description: "The count of books that have been returned."
  46. // launch_stage: GA
  47. // metric_kind: DELTA
  48. // value_type: INT64
  49. // unit: "1"
  50. // labels:
  51. // - key: customer_id
  52. // description: "The id of the customer."
  53. // - name: library.googleapis.com/book/num_overdue
  54. // display_name: "Books Overdue"
  55. // description: "The current number of overdue books."
  56. // launch_stage: GA
  57. // metric_kind: GAUGE
  58. // value_type: INT64
  59. // unit: "1"
  60. // labels:
  61. // - key: customer_id
  62. // description: "The id of the customer."
  63. // monitoring:
  64. // producer_destinations:
  65. // - monitored_resource: library.googleapis.com/Branch
  66. // metrics:
  67. // - library.googleapis.com/book/returned_count
  68. // consumer_destinations:
  69. // - monitored_resource: library.googleapis.com/Branch
  70. // metrics:
  71. // - library.googleapis.com/book/returned_count
  72. // - library.googleapis.com/book/num_overdue
  73. message Monitoring {
  74. // Configuration of a specific monitoring destination (the producer project
  75. // or the consumer project).
  76. message MonitoringDestination {
  77. // The monitored resource type. The type must be defined in
  78. // [Service.monitored_resources][google.api.Service.monitored_resources]
  79. // section.
  80. string monitored_resource = 1;
  81. // Types of the metrics to report to this monitoring destination.
  82. // Each type must be defined in
  83. // [Service.metrics][google.api.Service.metrics] section.
  84. repeated string metrics = 2;
  85. }
  86. // Monitoring configurations for sending metrics to the producer project.
  87. // There can be multiple producer destinations. A monitored resource type may
  88. // appear in multiple monitoring destinations if different aggregations are
  89. // needed for different sets of metrics associated with that monitored
  90. // resource type. A monitored resource and metric pair may only be used once
  91. // in the Monitoring configuration.
  92. repeated MonitoringDestination producer_destinations = 1;
  93. // Monitoring configurations for sending metrics to the consumer project.
  94. // There can be multiple consumer destinations. A monitored resource type may
  95. // appear in multiple monitoring destinations if different aggregations are
  96. // needed for different sets of metrics associated with that monitored
  97. // resource type. A monitored resource and metric pair may only be used once
  98. // in the Monitoring configuration.
  99. repeated MonitoringDestination consumer_destinations = 2;
  100. }