google-cloud-logging 1.10.8 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -2
  3. data/CHANGELOG.md +47 -0
  4. data/CONTRIBUTING.md +4 -5
  5. data/LOGGING.md +1 -1
  6. data/OVERVIEW.md +1 -2
  7. data/lib/google-cloud-logging.rb +15 -15
  8. data/lib/google/cloud/logging.rb +12 -13
  9. data/lib/google/cloud/logging/async_writer.rb +5 -4
  10. data/lib/google/cloud/logging/convert.rb +12 -7
  11. data/lib/google/cloud/logging/credentials.rb +2 -2
  12. data/lib/google/cloud/logging/entry.rb +5 -5
  13. data/lib/google/cloud/logging/entry/http_request.rb +5 -4
  14. data/lib/google/cloud/logging/entry/list.rb +4 -4
  15. data/lib/google/cloud/logging/entry/operation.rb +5 -4
  16. data/lib/google/cloud/logging/entry/source_location.rb +5 -4
  17. data/lib/google/cloud/logging/log/list.rb +4 -4
  18. data/lib/google/cloud/logging/logger.rb +7 -15
  19. data/lib/google/cloud/logging/metric.rb +2 -2
  20. data/lib/google/cloud/logging/metric/list.rb +4 -4
  21. data/lib/google/cloud/logging/middleware.rb +3 -5
  22. data/lib/google/cloud/logging/project.rb +1 -1
  23. data/lib/google/cloud/logging/rails.rb +7 -10
  24. data/lib/google/cloud/logging/resource_descriptor/list.rb +4 -4
  25. data/lib/google/cloud/logging/service.rb +73 -173
  26. data/lib/google/cloud/logging/sink.rb +2 -2
  27. data/lib/google/cloud/logging/sink/list.rb +4 -4
  28. data/lib/google/cloud/logging/version.rb +1 -1
  29. metadata +14 -84
  30. data/lib/google/cloud/logging/v2.rb +0 -18
  31. data/lib/google/cloud/logging/v2/config_service_v2_client.rb +0 -1368
  32. data/lib/google/cloud/logging/v2/config_service_v2_client_config.json +0 -106
  33. data/lib/google/cloud/logging/v2/credentials.rb +0 -39
  34. data/lib/google/cloud/logging/v2/doc/google/api/distribution.rb +0 -164
  35. data/lib/google/cloud/logging/v2/doc/google/api/label.rb +0 -42
  36. data/lib/google/cloud/logging/v2/doc/google/api/metric.rb +0 -274
  37. data/lib/google/cloud/logging/v2/doc/google/api/monitored_resource.rb +0 -104
  38. data/lib/google/cloud/logging/v2/doc/google/logging/type/http_request.rb +0 -86
  39. data/lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb +0 -179
  40. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb +0 -238
  41. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb +0 -660
  42. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb +0 -220
  43. data/lib/google/cloud/logging/v2/doc/google/protobuf/any.rb +0 -131
  44. data/lib/google/cloud/logging/v2/doc/google/protobuf/duration.rb +0 -91
  45. data/lib/google/cloud/logging/v2/doc/google/protobuf/empty.rb +0 -29
  46. data/lib/google/cloud/logging/v2/doc/google/protobuf/field_mask.rb +0 -222
  47. data/lib/google/cloud/logging/v2/doc/google/protobuf/struct.rb +0 -74
  48. data/lib/google/cloud/logging/v2/doc/google/protobuf/timestamp.rb +0 -113
  49. data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +0 -680
  50. data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +0 -61
  51. data/lib/google/cloud/logging/v2/metrics_service_v2_client.rb +0 -475
  52. data/lib/google/cloud/logging/v2/metrics_service_v2_client_config.json +0 -56
  53. data/lib/google/logging/v2/log_entry_pb.rb +0 -59
  54. data/lib/google/logging/v2/logging_config_pb.rb +0 -173
  55. data/lib/google/logging/v2/logging_config_services_pb.rb +0 -112
  56. data/lib/google/logging/v2/logging_metrics_pb.rb +0 -72
  57. data/lib/google/logging/v2/logging_metrics_services_pb.rb +0 -52
  58. data/lib/google/logging/v2/logging_pb.rb +0 -80
  59. data/lib/google/logging/v2/logging_services_pb.rb +0 -64
@@ -1,106 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.logging.v2.ConfigServiceV2": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "DEADLINE_EXCEEDED",
7
- "INTERNAL",
8
- "UNAVAILABLE"
9
- ],
10
- "non_idempotent": [],
11
- "idempotent2": [
12
- "DEADLINE_EXCEEDED",
13
- "UNAVAILABLE"
14
- ]
15
- },
16
- "retry_params": {
17
- "default": {
18
- "initial_retry_delay_millis": 100,
19
- "retry_delay_multiplier": 1.3,
20
- "max_retry_delay_millis": 60000,
21
- "initial_rpc_timeout_millis": 20000,
22
- "rpc_timeout_multiplier": 1.0,
23
- "max_rpc_timeout_millis": 20000,
24
- "total_timeout_millis": 600000
25
- }
26
- },
27
- "methods": {
28
- "DeleteSink": {
29
- "timeout_millis": 60000,
30
- "retry_codes_name": "idempotent",
31
- "retry_params_name": "default"
32
- },
33
- "UpdateSink": {
34
- "timeout_millis": 60000,
35
- "retry_codes_name": "idempotent",
36
- "retry_params_name": "default"
37
- },
38
- "DeleteExclusion": {
39
- "timeout_millis": 60000,
40
- "retry_codes_name": "idempotent",
41
- "retry_params_name": "default"
42
- },
43
- "ListBuckets": {
44
- "timeout_millis": 60000,
45
- "retry_codes_name": "idempotent2",
46
- "retry_params_name": "default"
47
- },
48
- "GetBucket": {
49
- "timeout_millis": 60000,
50
- "retry_codes_name": "idempotent2",
51
- "retry_params_name": "default"
52
- },
53
- "UpdateBucket": {
54
- "timeout_millis": 60000,
55
- "retry_codes_name": "non_idempotent",
56
- "retry_params_name": "default"
57
- },
58
- "ListSinks": {
59
- "timeout_millis": 60000,
60
- "retry_codes_name": "idempotent2",
61
- "retry_params_name": "default"
62
- },
63
- "GetSink": {
64
- "timeout_millis": 60000,
65
- "retry_codes_name": "idempotent2",
66
- "retry_params_name": "default"
67
- },
68
- "CreateSink": {
69
- "timeout_millis": 60000,
70
- "retry_codes_name": "non_idempotent",
71
- "retry_params_name": "default"
72
- },
73
- "ListExclusions": {
74
- "timeout_millis": 60000,
75
- "retry_codes_name": "idempotent2",
76
- "retry_params_name": "default"
77
- },
78
- "GetExclusion": {
79
- "timeout_millis": 60000,
80
- "retry_codes_name": "idempotent2",
81
- "retry_params_name": "default"
82
- },
83
- "CreateExclusion": {
84
- "timeout_millis": 60000,
85
- "retry_codes_name": "non_idempotent",
86
- "retry_params_name": "default"
87
- },
88
- "UpdateExclusion": {
89
- "timeout_millis": 60000,
90
- "retry_codes_name": "non_idempotent",
91
- "retry_params_name": "default"
92
- },
93
- "GetCmekSettings": {
94
- "timeout_millis": 60000,
95
- "retry_codes_name": "idempotent2",
96
- "retry_params_name": "default"
97
- },
98
- "UpdateCmekSettings": {
99
- "timeout_millis": 60000,
100
- "retry_codes_name": "non_idempotent",
101
- "retry_params_name": "default"
102
- }
103
- }
104
- }
105
- }
106
- }
@@ -1,39 +0,0 @@
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
- # https://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
-
15
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module Logging
21
- module V2
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = ["https://www.googleapis.com/auth/logging.admin"].freeze
24
- PATH_ENV_VARS = %w(LOGGING_CREDENTIALS
25
- LOGGING_KEYFILE
26
- GOOGLE_CLOUD_CREDENTIALS
27
- GOOGLE_CLOUD_KEYFILE
28
- GCLOUD_KEYFILE)
29
- JSON_ENV_VARS = %w(LOGGING_CREDENTIALS_JSON
30
- LOGGING_KEYFILE_JSON
31
- GOOGLE_CLOUD_CREDENTIALS_JSON
32
- GOOGLE_CLOUD_KEYFILE_JSON
33
- GCLOUD_KEYFILE_JSON)
34
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,164 +0,0 @@
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
- # https://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
-
15
-
16
- module Google
17
- module Api
18
- # `Distribution` contains summary statistics for a population of values. It
19
- # optionally contains a histogram representing the distribution of those values
20
- # across a set of buckets.
21
- #
22
- # The summary statistics are the count, mean, sum of the squared deviation from
23
- # the mean, the minimum, and the maximum of the set of population of values.
24
- # The histogram is based on a sequence of buckets and gives a count of values
25
- # that fall into each bucket. The boundaries of the buckets are given either
26
- # explicitly or by formulas for buckets of fixed or exponentially increasing
27
- # widths.
28
- #
29
- # Although it is not forbidden, it is generally a bad idea to include
30
- # non-finite values (infinities or NaNs) in the population of values, as this
31
- # will render the `mean` and `sum_of_squared_deviation` fields meaningless.
32
- # @!attribute [rw] count
33
- # @return [Integer]
34
- # The number of values in the population. Must be non-negative. This value
35
- # must equal the sum of the values in `bucket_counts` if a histogram is
36
- # provided.
37
- # @!attribute [rw] mean
38
- # @return [Float]
39
- # The arithmetic mean of the values in the population. If `count` is zero
40
- # then this field must be zero.
41
- # @!attribute [rw] sum_of_squared_deviation
42
- # @return [Float]
43
- # The sum of squared deviations from the mean of the values in the
44
- # population. For values x_i this is:
45
- #
46
- # Sum[i=1..n](https://cloud.google.com(x_i - mean)^2)
47
- #
48
- # Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition
49
- # describes Welford's method for accumulating this sum in one pass.
50
- #
51
- # If `count` is zero then this field must be zero.
52
- # @!attribute [rw] range
53
- # @return [Google::Api::Distribution::Range]
54
- # If specified, contains the range of the population values. The field
55
- # must not be present if the `count` is zero.
56
- # @!attribute [rw] bucket_options
57
- # @return [Google::Api::Distribution::BucketOptions]
58
- # Defines the histogram bucket boundaries. If the distribution does not
59
- # contain a histogram, then omit this field.
60
- # @!attribute [rw] bucket_counts
61
- # @return [Array<Integer>]
62
- # The number of values in each bucket of the histogram, as described in
63
- # `bucket_options`. If the distribution does not have a histogram, then omit
64
- # this field. If there is a histogram, then the sum of the values in
65
- # `bucket_counts` must equal the value in the `count` field of the
66
- # distribution.
67
- #
68
- # If present, `bucket_counts` should contain N values, where N is the number
69
- # of buckets specified in `bucket_options`. If you supply fewer than N
70
- # values, the remaining values are assumed to be 0.
71
- #
72
- # The order of the values in `bucket_counts` follows the bucket numbering
73
- # schemes described for the three bucket types. The first value must be the
74
- # count for the underflow bucket (number 0). The next N-2 values are the
75
- # counts for the finite buckets (number 1 through N-2). The N'th value in
76
- # `bucket_counts` is the count for the overflow bucket (number N-1).
77
- # @!attribute [rw] exemplars
78
- # @return [Array<Google::Api::Distribution::Exemplar>]
79
- # Must be in increasing order of `value` field.
80
- class Distribution
81
- # `BucketOptions` describes the bucket boundaries used to create a histogram
82
- # for the distribution. The buckets can be in a linear sequence, an
83
- # exponential sequence, or each bucket can be specified explicitly.
84
- # `BucketOptions` does not include the number of values in each bucket.
85
- #
86
- # A bucket has an inclusive lower bound and exclusive upper bound for the
87
- # values that are counted for that bucket. The upper bound of a bucket must
88
- # be strictly greater than the lower bound. The sequence of N buckets for a
89
- # distribution consists of an underflow bucket (number 0), zero or more
90
- # finite buckets (number 1 through N - 2) and an overflow bucket (number N -
91
- # 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the
92
- # same as the upper bound of bucket i - 1. The buckets span the whole range
93
- # of finite values: lower bound of the underflow bucket is -infinity and the
94
- # upper bound of the overflow bucket is +infinity. The finite buckets are
95
- # so-called because both bounds are finite.
96
- # @!attribute [rw] linear_buckets
97
- # @return [Google::Api::Distribution::BucketOptions::Linear]
98
- # The linear bucket.
99
- # @!attribute [rw] exponential_buckets
100
- # @return [Google::Api::Distribution::BucketOptions::Exponential]
101
- # The exponential buckets.
102
- # @!attribute [rw] explicit_buckets
103
- # @return [Google::Api::Distribution::BucketOptions::Explicit]
104
- # The explicit buckets.
105
- class BucketOptions
106
- # Specifies a linear sequence of buckets that all have the same width
107
- # (except overflow and underflow). Each bucket represents a constant
108
- # absolute uncertainty on the specific value in the bucket.
109
- #
110
- # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the
111
- # following boundaries:
112
- #
113
- # Upper bound (0 <= i < N-1): offset + (width * i).
114
- # Lower bound (1 <= i < N): offset + (width * (i - 1)).
115
- # @!attribute [rw] num_finite_buckets
116
- # @return [Integer]
117
- # Must be greater than 0.
118
- # @!attribute [rw] width
119
- # @return [Float]
120
- # Must be greater than 0.
121
- # @!attribute [rw] offset
122
- # @return [Float]
123
- # Lower bound of the first bucket.
124
- class Linear; end
125
-
126
- # Specifies an exponential sequence of buckets that have a width that is
127
- # proportional to the value of the lower bound. Each bucket represents a
128
- # constant relative uncertainty on a specific value in the bucket.
129
- #
130
- # There are `num_finite_buckets + 2` (= N) buckets. Bucket `i` has the
131
- # following boundaries:
132
- #
133
- # Upper bound (0 <= i < N-1): scale * (growth_factor ^ i).
134
- # Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)).
135
- # @!attribute [rw] num_finite_buckets
136
- # @return [Integer]
137
- # Must be greater than 0.
138
- # @!attribute [rw] growth_factor
139
- # @return [Float]
140
- # Must be greater than 1.
141
- # @!attribute [rw] scale
142
- # @return [Float]
143
- # Must be greater than 0.
144
- class Exponential; end
145
-
146
- # Specifies a set of buckets with arbitrary widths.
147
- #
148
- # There are `size(bounds) + 1` (= N) buckets. Bucket `i` has the following
149
- # boundaries:
150
- #
151
- # Upper bound (0 <= i < N-1): bounds[i]
152
- # Lower bound (1 <= i < N); bounds[i - 1]
153
- #
154
- # The `bounds` field must contain at least one element. If `bounds` has
155
- # only one element, then there are no finite buckets, and that single
156
- # element is the common boundary of the overflow and underflow buckets.
157
- # @!attribute [rw] bounds
158
- # @return [Array<Float>]
159
- # The values must be monotonically increasing.
160
- class Explicit; end
161
- end
162
- end
163
- end
164
- end
@@ -1,42 +0,0 @@
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
- # https://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
-
15
-
16
- module Google
17
- module Api
18
- # A description of a label.
19
- # @!attribute [rw] key
20
- # @return [String]
21
- # The label key.
22
- # @!attribute [rw] value_type
23
- # @return [Google::Api::LabelDescriptor::ValueType]
24
- # The type of data that can be assigned to the label.
25
- # @!attribute [rw] description
26
- # @return [String]
27
- # A human-readable description for the label.
28
- class LabelDescriptor
29
- # Value types that can be used as label values.
30
- module ValueType
31
- # A variable-length string. This is the default.
32
- STRING = 0
33
-
34
- # Boolean; true or false.
35
- BOOL = 1
36
-
37
- # A 64-bit signed integer.
38
- INT64 = 2
39
- end
40
- end
41
- end
42
- end
@@ -1,274 +0,0 @@
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
- # https://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
-
15
-
16
- module Google
17
- module Api
18
- # Defines a metric type and its schema. Once a metric descriptor is created,
19
- # deleting or altering it stops data collection and makes the metric type's
20
- # existing data unusable.
21
- #
22
- # The following are specific rules for service defined Monitoring metric
23
- # descriptors:
24
- #
25
- # * `type`, `metric_kind`, `value_type`, `description`, `display_name`,
26
- # `launch_stage` fields are all required. The `unit` field must be specified
27
- # if the `value_type` is any of DOUBLE, INT64, DISTRIBUTION.
28
- # * Maximum of default 500 metric descriptors per service is allowed.
29
- # * Maximum of default 10 labels per metric descriptor is allowed.
30
- #
31
- # The default maximum limit can be overridden. Please follow
32
- # https://cloud.google.com/monitoring/quotas
33
- # @!attribute [rw] name
34
- # @return [String]
35
- # The resource name of the metric descriptor.
36
- # @!attribute [rw] type
37
- # @return [String]
38
- # The metric type, including its DNS name prefix. The type is not
39
- # URL-encoded.
40
- #
41
- # All service defined metrics must be prefixed with the service name, in the
42
- # format of `{service name}/{relative metric name}`, such as
43
- # `cloudsql.googleapis.com/database/cpu/utilization`. The relative metric
44
- # name must follow:
45
- #
46
- # * Only upper and lower-case letters, digits, '/' and underscores '_' are
47
- # allowed.
48
- # * The maximum number of characters allowed for the relative_metric_name is
49
- # 100.
50
- #
51
- # All user-defined metric types have the DNS name
52
- # `custom.googleapis.com`, `external.googleapis.com`, or
53
- # `logging.googleapis.com/user/`.
54
- #
55
- # Metric types should use a natural hierarchical grouping. For example:
56
- #
57
- # "custom.googleapis.com/invoice/paid/amount"
58
- # "external.googleapis.com/prometheus/up"
59
- # "appengine.googleapis.com/http/server/response_latencies"
60
- # @!attribute [rw] labels
61
- # @return [Array<Google::Api::LabelDescriptor>]
62
- # The set of labels that can be used to describe a specific
63
- # instance of this metric type.
64
- #
65
- # The label key name must follow:
66
- #
67
- # * Only upper and lower-case letters, digits and underscores (_) are
68
- # allowed.
69
- # * Label name must start with a letter or digit.
70
- # * The maximum length of a label name is 100 characters.
71
- #
72
- # For example, the
73
- # `appengine.googleapis.com/http/server/response_latencies` metric
74
- # type has a label for the HTTP response code, `response_code`, so
75
- # you can look at latencies for successful responses or just
76
- # for responses that failed.
77
- # @!attribute [rw] metric_kind
78
- # @return [Google::Api::MetricDescriptor::MetricKind]
79
- # Whether the metric records instantaneous values, changes to a value, etc.
80
- # Some combinations of `metric_kind` and `value_type` might not be supported.
81
- # @!attribute [rw] value_type
82
- # @return [Google::Api::MetricDescriptor::ValueType]
83
- # Whether the measurement is an integer, a floating-point number, etc.
84
- # Some combinations of `metric_kind` and `value_type` might not be supported.
85
- # @!attribute [rw] unit
86
- # @return [String]
87
- # The units in which the metric value is reported. It is only applicable
88
- # if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
89
- # defines the representation of the stored metric values.
90
- #
91
- # Different systems may scale the values to be more easily displayed (so a
92
- # value of `0.02KBy` _might_ be displayed as `20By`, and a value of
93
- # `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
94
- # `KBy`, then the value of the metric is always in thousands of bytes, no
95
- # matter how it may be displayed..
96
- #
97
- # If you want a custom metric to record the exact number of CPU-seconds used
98
- # by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
99
- # `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
100
- # CPU-seconds, then the value is written as `12005`.
101
- #
102
- # Alternatively, if you want a custom metric to record data in a more
103
- # granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
104
- # `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
105
- # or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
106
- #
107
- # The supported units are a subset of [The Unified Code for Units of
108
- # Measure](http://unitsofmeasure.org/ucum.html) standard:
109
- #
110
- # **Basic units (UNIT)**
111
- #
112
- # * `bit` bit
113
- # * `By` byte
114
- # * `s` second
115
- # * `min` minute
116
- # * `h` hour
117
- # * `d` day
118
- #
119
- # **Prefixes (PREFIX)**
120
- #
121
- # * `k` kilo (10^3)
122
- # * `M` mega (10^6)
123
- # * `G` giga (10^9)
124
- # * `T` tera (10^12)
125
- # * `P` peta (10^15)
126
- # * `E` exa (10^18)
127
- # * `Z` zetta (10^21)
128
- # * `Y` yotta (10^24)
129
- #
130
- # * `m` milli (10^-3)
131
- # * `u` micro (10^-6)
132
- # * `n` nano (10^-9)
133
- # * `p` pico (10^-12)
134
- # * `f` femto (10^-15)
135
- # * `a` atto (10^-18)
136
- # * `z` zepto (10^-21)
137
- # * `y` yocto (10^-24)
138
- #
139
- # * `Ki` kibi (2^10)
140
- # * `Mi` mebi (2^20)
141
- # * `Gi` gibi (2^30)
142
- # * `Ti` tebi (2^40)
143
- # * `Pi` pebi (2^50)
144
- #
145
- # **Grammar**
146
- #
147
- # The grammar also includes these connectors:
148
- #
149
- # * `/` division or ratio (as an infix operator). For examples,
150
- # `kBy/{email}` or `MiBy/10ms` (although you should almost never
151
- # have `/s` in a metric `unit`; rates should always be computed at
152
- # query time from the underlying cumulative or delta value).
153
- # * `.` multiplication or composition (as an infix operator). For
154
- # examples, `GBy.d` or `k{watt}.h`.
155
- #
156
- # The grammar for a unit is as follows:
157
- #
158
- # Expression = Component { "." Component } { "/" Component } ;
159
- #
160
- # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
161
- # | Annotation
162
- # | "1"
163
- # ;
164
- #
165
- # Annotation = "{" NAME "}" ;
166
- #
167
- # Notes:
168
- #
169
- # * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
170
- # is used alone, then the unit is equivalent to `1`. For examples,
171
- # `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
172
- # * `NAME` is a sequence of non-blank printable ASCII characters not
173
- # containing `{` or `}`.
174
- # * `1` represents a unitary [dimensionless
175
- # unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
176
- # as in `1/s`. It is typically used when none of the basic units are
177
- # appropriate. For example, "new users per day" can be represented as
178
- # `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
179
- # users). Alternatively, "thousands of page views per day" would be
180
- # represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
181
- # value of `5.3` would mean "5300 page views per day").
182
- # * `%` represents dimensionless value of 1/100, and annotates values giving
183
- # a percentage (so the metric values are typically in the range of 0..100,
184
- # and a metric value `3` means "3 percent").
185
- # * `10^2.%` indicates a metric contains a ratio, typically in the range
186
- # 0..1, that will be multiplied by 100 and displayed as a percentage
187
- # (so a metric value `0.03` means "3 percent").
188
- # @!attribute [rw] description
189
- # @return [String]
190
- # A detailed description of the metric, which can be used in documentation.
191
- # @!attribute [rw] display_name
192
- # @return [String]
193
- # A concise name for the metric, which can be displayed in user interfaces.
194
- # Use sentence case without an ending period, for example "Request count".
195
- # This field is optional but it is recommended to be set for any metrics
196
- # associated with user-visible concepts, such as Quota.
197
- # @!attribute [rw] metadata
198
- # @return [Google::Api::MetricDescriptor::MetricDescriptorMetadata]
199
- # Optional. Metadata which can be used to guide usage of the metric.
200
- # @!attribute [rw] launch_stage
201
- # @return [Google::Api::LaunchStage]
202
- # Optional. The launch stage of the metric definition.
203
- # @!attribute [rw] monitored_resource_types
204
- # @return [Array<String>]
205
- # Read-only. If present, then a [time
206
- # series][google.monitoring.v3.TimeSeries], which is identified partially by
207
- # a metric type and a {Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor}, that is associated
208
- # with this metric type can only be associated with one of the monitored
209
- # resource types listed here.
210
- class MetricDescriptor
211
- # Additional annotations that can be used to guide the usage of a metric.
212
- # @!attribute [rw] launch_stage
213
- # @return [Google::Api::LaunchStage]
214
- # Deprecated. Must use the {Google::Api::MetricDescriptor#launch_stage MetricDescriptor#launch_stage} instead.
215
- # @!attribute [rw] sample_period
216
- # @return [Google::Protobuf::Duration]
217
- # The sampling period of metric data points. For metrics which are written
218
- # periodically, consecutive data points are stored at this time interval,
219
- # excluding data loss due to errors. Metrics with a higher granularity have
220
- # a smaller sampling period.
221
- # @!attribute [rw] ingest_delay
222
- # @return [Google::Protobuf::Duration]
223
- # The delay of data points caused by ingestion. Data points older than this
224
- # age are guaranteed to be ingested and available to be read, excluding
225
- # data loss due to errors.
226
- class MetricDescriptorMetadata; end
227
-
228
- # The kind of measurement. It describes how the data is reported.
229
- module MetricKind
230
- # Do not use this default value.
231
- METRIC_KIND_UNSPECIFIED = 0
232
-
233
- # An instantaneous measurement of a value.
234
- GAUGE = 1
235
-
236
- # The change in a value during a time interval.
237
- DELTA = 2
238
-
239
- # A value accumulated over a time interval. Cumulative
240
- # measurements in a time series should have the same start time
241
- # and increasing end times, until an event resets the cumulative
242
- # value to zero and sets a new start time for the following
243
- # points.
244
- CUMULATIVE = 3
245
- end
246
-
247
- # The value type of a metric.
248
- module ValueType
249
- # Do not use this default value.
250
- VALUE_TYPE_UNSPECIFIED = 0
251
-
252
- # The value is a boolean.
253
- # This value type can be used only if the metric kind is `GAUGE`.
254
- BOOL = 1
255
-
256
- # The value is a signed 64-bit integer.
257
- INT64 = 2
258
-
259
- # The value is a double precision floating point number.
260
- DOUBLE = 3
261
-
262
- # The value is a text string.
263
- # This value type can be used only if the metric kind is `GAUGE`.
264
- STRING = 4
265
-
266
- # The value is a {Google::Api::Distribution `Distribution`}.
267
- DISTRIBUTION = 5
268
-
269
- # The value is money.
270
- MONEY = 6
271
- end
272
- end
273
- end
274
- end