billing.proto 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 = "BillingProto";
  19. option java_package = "com.google.api";
  20. option objc_class_prefix = "GAPI";
  21. // Billing related configuration of the service.
  22. //
  23. // The following example shows how to configure monitored resources and metrics
  24. // for billing, `consumer_destinations` is the only supported destination and
  25. // the monitored resources need at least one label key
  26. // `cloud.googleapis.com/location` to indicate the location of the billing
  27. // usage, using different monitored resources between monitoring and billing is
  28. // recommended so they can be evolved independently:
  29. //
  30. //
  31. // monitored_resources:
  32. // - type: library.googleapis.com/billing_branch
  33. // labels:
  34. // - key: cloud.googleapis.com/location
  35. // description: |
  36. // Predefined label to support billing location restriction.
  37. // - key: city
  38. // description: |
  39. // Custom label to define the city where the library branch is located
  40. // in.
  41. // - key: name
  42. // description: Custom label to define the name of the library branch.
  43. // metrics:
  44. // - name: library.googleapis.com/book/borrowed_count
  45. // metric_kind: DELTA
  46. // value_type: INT64
  47. // unit: "1"
  48. // billing:
  49. // consumer_destinations:
  50. // - monitored_resource: library.googleapis.com/billing_branch
  51. // metrics:
  52. // - library.googleapis.com/book/borrowed_count
  53. message Billing {
  54. // Configuration of a specific billing destination (Currently only support
  55. // bill against consumer project).
  56. message BillingDestination {
  57. // The monitored resource type. The type must be defined in
  58. // [Service.monitored_resources][google.api.Service.monitored_resources]
  59. // section.
  60. string monitored_resource = 1;
  61. // Names of the metrics to report to this billing destination.
  62. // Each name must be defined in
  63. // [Service.metrics][google.api.Service.metrics] section.
  64. repeated string metrics = 2;
  65. }
  66. // Billing configurations for sending metrics to the consumer project.
  67. // There can be multiple consumer destinations per service, each one must have
  68. // a different monitored resource type. A metric can be used in at most
  69. // one consumer destination.
  70. repeated BillingDestination consumer_destinations = 8;
  71. }