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# 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
15apiVersion: apiextensions.k8s.io/v1
16kind: CustomResourceDefinition
17metadata:
18 annotations:
19 cnrm.cloud.google.com/version: 1.106.0
20 creationTimestamp: null
21 labels:
22 cnrm.cloud.google.com/dcl2crd: "true"
23 cnrm.cloud.google.com/managed-by-kcc: "true"
24 cnrm.cloud.google.com/stability-level: stable
25 cnrm.cloud.google.com/system: "true"
26 name: logginglogmetrics.logging.cnrm.cloud.google.com
27spec:
28 group: logging.cnrm.cloud.google.com
29 names:
30 categories:
31 - gcp
32 kind: LoggingLogMetric
33 plural: logginglogmetrics
34 shortNames:
35 - gcplogginglogmetric
36 - gcplogginglogmetrics
37 singular: logginglogmetric
38 scope: Namespaced
39 versions:
40 - additionalPrinterColumns:
41 - jsonPath: .metadata.creationTimestamp
42 name: Age
43 type: date
44 - description: When 'True', the most recent reconcile of the resource succeeded
45 jsonPath: .status.conditions[?(@.type=='Ready')].status
46 name: Ready
47 type: string
48 - description: The reason for the value in 'Ready'
49 jsonPath: .status.conditions[?(@.type=='Ready')].reason
50 name: Status
51 type: string
52 - description: The last transition time for the value in 'Status'
53 jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime
54 name: Status Age
55 type: date
56 name: v1beta1
57 schema:
58 openAPIV3Schema:
59 properties:
60 apiVersion:
61 description: 'apiVersion defines the versioned schema of this representation
62 of an object. Servers should convert recognized schemas to the latest
63 internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
64 type: string
65 kind:
66 description: 'kind is a string value representing the REST resource this
67 object represents. Servers may infer this from the endpoint the client
68 submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
69 type: string
70 metadata:
71 type: object
72 spec:
73 properties:
74 bucketOptions:
75 description: Optional. The `bucket_options` are required when the
76 logs-based metric is using a DISTRIBUTION value type and it describes
77 the bucket boundaries used to create a histogram of the extracted
78 values.
79 properties:
80 explicitBuckets:
81 description: The explicit buckets.
82 properties:
83 bounds:
84 description: The values must be monotonically increasing.
85 items:
86 format: double
87 type: number
88 type: array
89 type: object
90 exponentialBuckets:
91 description: The exponential buckets.
92 properties:
93 growthFactor:
94 description: Must be greater than 1.
95 format: double
96 type: number
97 numFiniteBuckets:
98 description: Must be greater than 0.
99 format: int64
100 type: integer
101 scale:
102 description: Must be greater than 0.
103 format: double
104 type: number
105 type: object
106 linearBuckets:
107 description: The linear bucket.
108 properties:
109 numFiniteBuckets:
110 description: Must be greater than 0.
111 format: int64
112 type: integer
113 offset:
114 description: Lower bound of the first bucket.
115 format: double
116 type: number
117 width:
118 description: Must be greater than 0.
119 format: double
120 type: number
121 type: object
122 type: object
123 description:
124 description: Optional. A description of this metric, which is used
125 in documentation. The maximum length of the description is 8000
126 characters.
127 type: string
128 disabled:
129 description: Optional. If set to True, then this metric is disabled
130 and it does not generate any points.
131 type: boolean
132 filter:
133 description: 'Required. An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters)
134 which is used to match log entries. Example: "resource.type=gae_app
135 AND severity>=ERROR" The maximum length of the filter is 20000 characters.'
136 type: string
137 labelExtractors:
138 additionalProperties:
139 type: string
140 description: Optional. A map from a label key string to an extractor
141 expression which is used to extract data from a log entry field
142 and assign as the label value. Each label key specified in the LabelDescriptor
143 must have an associated extractor expression in this map. The syntax
144 of the extractor expression is the same as for the `value_extractor`
145 field. The extracted value is converted to the type defined in the
146 label descriptor. If the either the extraction or the type conversion
147 fails, the label will have a default value. The default value for
148 a string label is an empty string, for an integer label its 0, and
149 for a boolean label its `false`. Note that there are upper bounds
150 on the maximum number of labels and the number of active time series
151 that are allowed in a project.
152 type: object
153 metricDescriptor:
154 description: Optional. The metric descriptor associated with the logs-based
155 metric. If unspecified, it uses a default metric descriptor with
156 a DELTA metric kind, INT64 value type, with no labels and a unit
157 of "1". Such a metric counts the number of log entries matching
158 the `filter` expression. The `name`, `type`, and `description` fields
159 in the `metric_descriptor` are output only, and is constructed using
160 the `name` and `description` field in the LogMetric. To create a
161 logs-based metric that records a distribution of log values, a DELTA
162 metric kind with a DISTRIBUTION value type must be used along with
163 a `value_extractor` expression in the LogMetric. Each label in the
164 metric descriptor must have a matching label name as the key and
165 an extractor expression as the value in the `label_extractors` map.
166 The `metric_kind` and `value_type` fields in the `metric_descriptor`
167 cannot be updated once initially configured. New labels can be added
168 in the `metric_descriptor`, but existing labels cannot be modified
169 except for their description.
170 properties:
171 displayName:
172 description: A concise name for the metric, which can be displayed
173 in user interfaces. Use sentence case without an ending period,
174 for example "Request count". This field is optional but it is
175 recommended to be set for any metrics associated with user-visible
176 concepts, such as Quota.
177 type: string
178 labels:
179 description: The set of labels that can be used to describe a
180 specific instance of this metric type. For example, the `appengine.googleapis.com/http/server/response_latencies`
181 metric type has a label for the HTTP response code, `response_code`,
182 so you can look at latencies for successful responses or just
183 for responses that failed.
184 items:
185 properties:
186 description:
187 description: Immutable. A human-readable description for
188 the label.
189 type: string
190 key:
191 description: Immutable. The label key.
192 type: string
193 valueType:
194 description: 'Immutable. The type of data that can be assigned
195 to the label. Possible values: STRING, BOOL, INT64, DOUBLE,
196 DISTRIBUTION, MONEY'
197 type: string
198 type: object
199 type: array
200 launchStage:
201 description: 'Optional. The launch stage of the metric definition.
202 Possible values: UNIMPLEMENTED, PRELAUNCH, EARLY_ACCESS, ALPHA,
203 BETA, GA, DEPRECATED'
204 type: string
205 metadata:
206 description: Optional. Metadata which can be used to guide usage
207 of the metric.
208 properties:
209 ingestDelay:
210 description: The delay of data points caused by ingestion.
211 Data points older than this age are guaranteed to be ingested
212 and available to be read, excluding data loss due to errors.
213 type: string
214 samplePeriod:
215 description: The sampling period of metric data points. For
216 metrics which are written periodically, consecutive data
217 points are stored at this time interval, excluding data
218 loss due to errors. Metrics with a higher granularity have
219 a smaller sampling period.
220 type: string
221 type: object
222 metricKind:
223 description: 'Immutable. Whether the metric records instantaneous
224 values, changes to a value, etc. Some combinations of `metric_kind`
225 and `value_type` might not be supported. Possible values: GAUGE,
226 DELTA, CUMULATIVE'
227 type: string
228 unit:
229 description: 'The units in which the metric value is reported.
230 It is only applicable if the `value_type` is `INT64`, `DOUBLE`,
231 or `DISTRIBUTION`. The `unit` defines the representation of
232 the stored metric values. Different systems might scale the
233 values to be more easily displayed (so a value of `0.02kBy`
234 _might_ be displayed as `20By`, and a value of `3523kBy` _might_
235 be displayed as `3.5MBy`). However, if the `unit` is `kBy`,
236 then the value of the metric is always in thousands of bytes,
237 no matter how it might be displayed. If you want a custom metric
238 to record the exact number of CPU-seconds used by a job, you
239 can create an `INT64 CUMULATIVE` metric whose `unit` is `s{CPU}`
240 (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
241 CPU-seconds, then the value is written as `12005`. Alternatively,
242 if you want a custom metric to record data in a more granular
243 way, you can create a `DOUBLE CUMULATIVE` metric whose `unit`
244 is `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
245 or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
246 The supported units are a subset of [The Unified Code for Units
247 of Measure](https://unitsofmeasure.org/ucum.html) standard:
248 **Basic units (UNIT)** * `bit` bit * `By` byte * `s` second
249 * `min` minute * `h` hour * `d` day * `1` dimensionless **Prefixes
250 (PREFIX)** * `k` kilo (10^3) * `M` mega (10^6) * `G` giga (10^9)
251 * `T` tera (10^12) * `P` peta (10^15) * `E` exa (10^18) * `Z`
252 zetta (10^21) * `Y` yotta (10^24) * `m` milli (10^-3) * `u`
253 micro (10^-6) * `n` nano (10^-9) * `p` pico (10^-12) * `f` femto
254 (10^-15) * `a` atto (10^-18) * `z` zepto (10^-21) * `y` yocto
255 (10^-24) * `Ki` kibi (2^10) * `Mi` mebi (2^20) * `Gi` gibi (2^30)
256 * `Ti` tebi (2^40) * `Pi` pebi (2^50) **Grammar** The grammar
257 also includes these connectors: * `/` division or ratio (as
258 an infix operator). For examples, `kBy/{email}` or `MiBy/10ms`
259 (although you should almost never have `/s` in a metric `unit`;
260 rates should always be computed at query time from the underlying
261 cumulative or delta value). * `.` multiplication or composition
262 (as an infix operator). For examples, `GBy.d` or `k{watt}.h`.
263 The grammar for a unit is as follows: Expression = Component:
264 { "." Component } { "/" Component } ; Component = ( [ PREFIX
265 ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; Annotation
266 = "{" NAME "}" ; Notes: * `Annotation` is just a comment if
267 it follows a `UNIT`. If the annotation is used alone, then the
268 unit is equivalent to `1`. For examples, `{request}/s == 1/s`,
269 `By{transmitted}/s == By/s`. * `NAME` is a sequence of non-blank
270 printable ASCII characters not containing `{` or `}`. * `1`
271 represents a unitary [dimensionless unit](https://en.wikipedia.org/wiki/Dimensionless_quantity)
272 of 1, such as in `1/s`. It is typically used when none of the
273 basic units are appropriate. For example, "new users per day"
274 can be represented as `1/d` or `{new-users}/d` (and a metric
275 value `5` would mean "5 new users). Alternatively, "thousands
276 of page views per day" would be represented as `1000/d` or `k1/d`
277 or `k{page_views}/d` (and a metric value of `5.3` would mean
278 "5300 page views per day"). * `%` represents dimensionless value
279 of 1/100, and annotates values giving a percentage (so the metric
280 values are typically in the range of 0..100, and a metric value
281 `3` means "3 percent"). * `10^2.%` indicates a metric contains
282 a ratio, typically in the range 0..1, that will be multiplied
283 by 100 and displayed as a percentage (so a metric value `0.03`
284 means "3 percent").'
285 type: string
286 valueType:
287 description: 'Immutable. Whether the measurement is an integer,
288 a floating-point number, etc. Some combinations of `metric_kind`
289 and `value_type` might not be supported. Possible values: STRING,
290 BOOL, INT64, DOUBLE, DISTRIBUTION, MONEY'
291 type: string
292 type: object
293 projectRef:
294 description: Immutable. The Project that this resource belongs to.
295 oneOf:
296 - not:
297 required:
298 - external
299 required:
300 - name
301 - not:
302 anyOf:
303 - required:
304 - name
305 - required:
306 - namespace
307 required:
308 - external
309 properties:
310 external:
311 description: |-
312 The resource name of the project in which to create the metric.
313
314 Allowed value: The Google Cloud resource name of a `Project` resource (format: `projects/{{name}}`).
315 type: string
316 name:
317 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
318 type: string
319 namespace:
320 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
321 type: string
322 type: object
323 resourceID:
324 description: Immutable. Optional. The name of the resource. Used for
325 creation and acquisition. When unset, the value of `metadata.name`
326 is used as the default.
327 type: string
328 valueExtractor:
329 description: 'Optional. A `value_extractor` is required when using
330 a distribution logs-based metric to extract the values to record
331 from a log entry. Two functions are supported for value extraction:
332 `EXTRACT(field)` or `REGEXP_EXTRACT(field, regex)`. The argument
333 are: 1. field: The name of the log entry field from which the value
334 is to be extracted. 2. regex: A regular expression using the Google
335 RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single
336 capture group to extract data from the specified log entry field.
337 The value of the field is converted to a string before applying
338 the regex. It is an error to specify a regex that does not include
339 exactly one capture group. The result of the extraction must be
340 convertible to a double type, as the distribution always records
341 double values. If either the extraction or the conversion to double
342 fails, then those values are not recorded in the distribution. Example:
343 `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(d+).*")`'
344 type: string
345 required:
346 - filter
347 - projectRef
348 type: object
349 status:
350 properties:
351 conditions:
352 description: Conditions represent the latest available observation
353 of the resource's current state.
354 items:
355 properties:
356 lastTransitionTime:
357 description: Last time the condition transitioned from one status
358 to another.
359 type: string
360 message:
361 description: Human-readable message indicating details about
362 last transition.
363 type: string
364 reason:
365 description: Unique, one-word, CamelCase reason for the condition's
366 last transition.
367 type: string
368 status:
369 description: Status is the status of the condition. Can be True,
370 False, Unknown.
371 type: string
372 type:
373 description: Type is the type of the condition.
374 type: string
375 type: object
376 type: array
377 createTime:
378 description: Output only. The creation timestamp of the metric. This
379 field may not be present for older metrics.
380 format: date-time
381 type: string
382 metricDescriptor:
383 properties:
384 description:
385 description: A detailed description of the metric, which can be
386 used in documentation.
387 type: string
388 monitoredResourceTypes:
389 description: Read-only. If present, then a time series, which
390 is identified partially by a metric type and a MonitoredResourceDescriptor,
391 that is associated with this metric type can only be associated
392 with one of the monitored resource types listed here.
393 items:
394 type: string
395 type: array
396 name:
397 description: The resource name of the metric descriptor.
398 type: string
399 type:
400 description: 'The metric type, including its DNS name prefix.
401 The type is not URL-encoded. All user-defined metric types have
402 the DNS name `custom.googleapis.com` or `external.googleapis.com`.
403 Metric types should use a natural hierarchical grouping. For
404 example: "custom.googleapis.com/invoice/paid/amount" "external.googleapis.com/prometheus/up"
405 "appengine.googleapis.com/http/server/response_latencies"'
406 type: string
407 type: object
408 observedGeneration:
409 description: ObservedGeneration is the generation of the resource
410 that was most recently observed by the Config Connector controller.
411 If this is equal to metadata.generation, then that means that the
412 current reported status reflects the most recent desired state of
413 the resource.
414 type: integer
415 updateTime:
416 description: Output only. The last update timestamp of the metric.
417 This field may not be present for older metrics.
418 format: date-time
419 type: string
420 type: object
421 required:
422 - spec
423 type: object
424 served: true
425 storage: true
426 subresources:
427 status: {}
428status:
429 acceptedNames:
430 kind: ""
431 plural: ""
432 conditions: []
433 storedVersions: []
View as plain text