monitoring.proto 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright 2016 Google Inc.
  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. import "google/api/annotations.proto";
  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/overdue_count` metric is only sent to the
  28. // consumer project.
  29. //
  30. // monitored_resources:
  31. // - type: library.googleapis.com/branch
  32. // labels:
  33. // - key: /city
  34. // description: The city where the library branch is located in.
  35. // - key: /name
  36. // description: The name of the branch.
  37. // metrics:
  38. // - name: library.googleapis.com/book/returned_count
  39. // metric_kind: DELTA
  40. // value_type: INT64
  41. // labels:
  42. // - key: /customer_id
  43. // - name: library.googleapis.com/book/overdue_count
  44. // metric_kind: GAUGE
  45. // value_type: INT64
  46. // labels:
  47. // - key: /customer_id
  48. // monitoring:
  49. // producer_destinations:
  50. // - monitored_resource: library.googleapis.com/branch
  51. // metrics:
  52. // - library.googleapis.com/book/returned_count
  53. // consumer_destinations:
  54. // - monitored_resource: library.googleapis.com/branch
  55. // metrics:
  56. // - library.googleapis.com/book/returned_count
  57. // - library.googleapis.com/book/overdue_count
  58. message Monitoring {
  59. // Configuration of a specific monitoring destination (the producer project
  60. // or the consumer project).
  61. message MonitoringDestination {
  62. // The monitored resource type. The type must be defined in
  63. // [Service.monitored_resources][google.api.Service.monitored_resources] section.
  64. string monitored_resource = 1;
  65. // Names of the metrics to report to this monitoring destination.
  66. // Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
  67. repeated string metrics = 2;
  68. }
  69. // Monitoring configurations for sending metrics to the producer project.
  70. // There can be multiple producer destinations, each one must have a
  71. // different monitored resource type. A metric can be used in at most
  72. // one producer destination.
  73. repeated MonitoringDestination producer_destinations = 1;
  74. // Monitoring configurations for sending metrics to the consumer project.
  75. // There can be multiple consumer destinations, each one must have a
  76. // different monitored resource type. A metric can be used in at most
  77. // one consumer destination.
  78. repeated MonitoringDestination consumer_destinations = 2;
  79. }