google-cloud-logging 1.10.9 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +23 -0
  4. data/lib/google-cloud-logging.rb +14 -15
  5. data/lib/google/cloud/logging.rb +12 -13
  6. data/lib/google/cloud/logging/credentials.rb +2 -2
  7. data/lib/google/cloud/logging/entry.rb +5 -5
  8. data/lib/google/cloud/logging/entry/http_request.rb +3 -3
  9. data/lib/google/cloud/logging/entry/list.rb +1 -1
  10. data/lib/google/cloud/logging/entry/operation.rb +3 -3
  11. data/lib/google/cloud/logging/entry/source_location.rb +3 -3
  12. data/lib/google/cloud/logging/log/list.rb +1 -1
  13. data/lib/google/cloud/logging/metric.rb +2 -2
  14. data/lib/google/cloud/logging/metric/list.rb +1 -1
  15. data/lib/google/cloud/logging/resource_descriptor/list.rb +1 -1
  16. data/lib/google/cloud/logging/service.rb +70 -173
  17. data/lib/google/cloud/logging/sink.rb +2 -2
  18. data/lib/google/cloud/logging/sink/list.rb +1 -1
  19. data/lib/google/cloud/logging/version.rb +1 -1
  20. metadata +10 -80
  21. data/lib/google/cloud/logging/v2.rb +0 -18
  22. data/lib/google/cloud/logging/v2/config_service_v2_client.rb +0 -1368
  23. data/lib/google/cloud/logging/v2/config_service_v2_client_config.json +0 -106
  24. data/lib/google/cloud/logging/v2/credentials.rb +0 -39
  25. data/lib/google/cloud/logging/v2/doc/google/api/distribution.rb +0 -164
  26. data/lib/google/cloud/logging/v2/doc/google/api/label.rb +0 -42
  27. data/lib/google/cloud/logging/v2/doc/google/api/metric.rb +0 -275
  28. data/lib/google/cloud/logging/v2/doc/google/api/monitored_resource.rb +0 -118
  29. data/lib/google/cloud/logging/v2/doc/google/logging/type/http_request.rb +0 -86
  30. data/lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb +0 -179
  31. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb +0 -238
  32. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb +0 -660
  33. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb +0 -220
  34. data/lib/google/cloud/logging/v2/doc/google/protobuf/any.rb +0 -131
  35. data/lib/google/cloud/logging/v2/doc/google/protobuf/duration.rb +0 -91
  36. data/lib/google/cloud/logging/v2/doc/google/protobuf/empty.rb +0 -29
  37. data/lib/google/cloud/logging/v2/doc/google/protobuf/field_mask.rb +0 -222
  38. data/lib/google/cloud/logging/v2/doc/google/protobuf/struct.rb +0 -74
  39. data/lib/google/cloud/logging/v2/doc/google/protobuf/timestamp.rb +0 -113
  40. data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +0 -680
  41. data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +0 -61
  42. data/lib/google/cloud/logging/v2/metrics_service_v2_client.rb +0 -475
  43. data/lib/google/cloud/logging/v2/metrics_service_v2_client_config.json +0 -56
  44. data/lib/google/logging/v2/log_entry_pb.rb +0 -59
  45. data/lib/google/logging/v2/logging_config_pb.rb +0 -173
  46. data/lib/google/logging/v2/logging_config_services_pb.rb +0 -112
  47. data/lib/google/logging/v2/logging_metrics_pb.rb +0 -72
  48. data/lib/google/logging/v2/logging_metrics_services_pb.rb +0 -52
  49. data/lib/google/logging/v2/logging_pb.rb +0 -80
  50. 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,275 +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
- # * `1` dimensionless
119
- #
120
- # **Prefixes (PREFIX)**
121
- #
122
- # * `k` kilo (10^3)
123
- # * `M` mega (10^6)
124
- # * `G` giga (10^9)
125
- # * `T` tera (10^12)
126
- # * `P` peta (10^15)
127
- # * `E` exa (10^18)
128
- # * `Z` zetta (10^21)
129
- # * `Y` yotta (10^24)
130
- #
131
- # * `m` milli (10^-3)
132
- # * `u` micro (10^-6)
133
- # * `n` nano (10^-9)
134
- # * `p` pico (10^-12)
135
- # * `f` femto (10^-15)
136
- # * `a` atto (10^-18)
137
- # * `z` zepto (10^-21)
138
- # * `y` yocto (10^-24)
139
- #
140
- # * `Ki` kibi (2^10)
141
- # * `Mi` mebi (2^20)
142
- # * `Gi` gibi (2^30)
143
- # * `Ti` tebi (2^40)
144
- # * `Pi` pebi (2^50)
145
- #
146
- # **Grammar**
147
- #
148
- # The grammar also includes these connectors:
149
- #
150
- # * `/` division or ratio (as an infix operator). For examples,
151
- # `kBy/{email}` or `MiBy/10ms` (although you should almost never
152
- # have `/s` in a metric `unit`; rates should always be computed at
153
- # query time from the underlying cumulative or delta value).
154
- # * `.` multiplication or composition (as an infix operator). For
155
- # examples, `GBy.d` or `k{watt}.h`.
156
- #
157
- # The grammar for a unit is as follows:
158
- #
159
- # Expression = Component { "." Component } { "/" Component } ;
160
- #
161
- # Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
162
- # | Annotation
163
- # | "1"
164
- # ;
165
- #
166
- # Annotation = "{" NAME "}" ;
167
- #
168
- # Notes:
169
- #
170
- # * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
171
- # is used alone, then the unit is equivalent to `1`. For examples,
172
- # `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
173
- # * `NAME` is a sequence of non-blank printable ASCII characters not
174
- # containing `{` or `}`.
175
- # * `1` represents a unitary [dimensionless
176
- # unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
177
- # as in `1/s`. It is typically used when none of the basic units are
178
- # appropriate. For example, "new users per day" can be represented as
179
- # `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
180
- # users). Alternatively, "thousands of page views per day" would be
181
- # represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
182
- # value of `5.3` would mean "5300 page views per day").
183
- # * `%` represents dimensionless value of 1/100, and annotates values giving
184
- # a percentage (so the metric values are typically in the range of 0..100,
185
- # and a metric value `3` means "3 percent").
186
- # * `10^2.%` indicates a metric contains a ratio, typically in the range
187
- # 0..1, that will be multiplied by 100 and displayed as a percentage
188
- # (so a metric value `0.03` means "3 percent").
189
- # @!attribute [rw] description
190
- # @return [String]
191
- # A detailed description of the metric, which can be used in documentation.
192
- # @!attribute [rw] display_name
193
- # @return [String]
194
- # A concise name for the metric, which can be displayed in user interfaces.
195
- # Use sentence case without an ending period, for example "Request count".
196
- # This field is optional but it is recommended to be set for any metrics
197
- # associated with user-visible concepts, such as Quota.
198
- # @!attribute [rw] metadata
199
- # @return [Google::Api::MetricDescriptor::MetricDescriptorMetadata]
200
- # Optional. Metadata which can be used to guide usage of the metric.
201
- # @!attribute [rw] launch_stage
202
- # @return [Google::Api::LaunchStage]
203
- # Optional. The launch stage of the metric definition.
204
- # @!attribute [rw] monitored_resource_types
205
- # @return [Array<String>]
206
- # Read-only. If present, then a [time
207
- # series][google.monitoring.v3.TimeSeries], which is identified partially by
208
- # a metric type and a {Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor}, that is associated
209
- # with this metric type can only be associated with one of the monitored
210
- # resource types listed here.
211
- class MetricDescriptor
212
- # Additional annotations that can be used to guide the usage of a metric.
213
- # @!attribute [rw] launch_stage
214
- # @return [Google::Api::LaunchStage]
215
- # Deprecated. Must use the {Google::Api::MetricDescriptor#launch_stage MetricDescriptor#launch_stage} instead.
216
- # @!attribute [rw] sample_period
217
- # @return [Google::Protobuf::Duration]
218
- # The sampling period of metric data points. For metrics which are written
219
- # periodically, consecutive data points are stored at this time interval,
220
- # excluding data loss due to errors. Metrics with a higher granularity have
221
- # a smaller sampling period.
222
- # @!attribute [rw] ingest_delay
223
- # @return [Google::Protobuf::Duration]
224
- # The delay of data points caused by ingestion. Data points older than this
225
- # age are guaranteed to be ingested and available to be read, excluding
226
- # data loss due to errors.
227
- class MetricDescriptorMetadata; end
228
-
229
- # The kind of measurement. It describes how the data is reported.
230
- module MetricKind
231
- # Do not use this default value.
232
- METRIC_KIND_UNSPECIFIED = 0
233
-
234
- # An instantaneous measurement of a value.
235
- GAUGE = 1
236
-
237
- # The change in a value during a time interval.
238
- DELTA = 2
239
-
240
- # A value accumulated over a time interval. Cumulative
241
- # measurements in a time series should have the same start time
242
- # and increasing end times, until an event resets the cumulative
243
- # value to zero and sets a new start time for the following
244
- # points.
245
- CUMULATIVE = 3
246
- end
247
-
248
- # The value type of a metric.
249
- module ValueType
250
- # Do not use this default value.
251
- VALUE_TYPE_UNSPECIFIED = 0
252
-
253
- # The value is a boolean.
254
- # This value type can be used only if the metric kind is `GAUGE`.
255
- BOOL = 1
256
-
257
- # The value is a signed 64-bit integer.
258
- INT64 = 2
259
-
260
- # The value is a double precision floating point number.
261
- DOUBLE = 3
262
-
263
- # The value is a text string.
264
- # This value type can be used only if the metric kind is `GAUGE`.
265
- STRING = 4
266
-
267
- # The value is a {Google::Api::Distribution `Distribution`}.
268
- DISTRIBUTION = 5
269
-
270
- # The value is money.
271
- MONEY = 6
272
- end
273
- end
274
- end
275
- end