...
1# Copyright 2022 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: logging.cnrm.cloud.google.com/v1beta1
16kind: LoggingLogMetric
17metadata:
18 name: logginglogmetric-sample-linearlogmetric
19spec:
20 description: "A sample log metric"
21 filter: "resource.type=gae_app AND severity<=ERROR"
22 disabled: false
23 metricDescriptor:
24 labels:
25 - key: "mass"
26 valueType: "STRING"
27 description: "amount of matter"
28 - key: "sku"
29 valueType: "INT64"
30 description: "identifying number for item"
31 metricKind: "DELTA"
32 valueType: "DISTRIBUTION"
33 unit: "bit"
34 displayName: "sample-descriptor"
35 metadata:
36 samplePeriod: "5s"
37 ingestDelay: "2s"
38 launchStage: "UNIMPLEMENTED"
39 valueExtractor: "EXTRACT(jsonPayload.request)"
40 labelExtractors:
41 mass: "EXTRACT(jsonPayload.request)"
42 sku: "EXTRACT(jsonPayload.id)"
43 bucketOptions:
44 linearBuckets:
45 numFiniteBuckets: 3
46 width: 3.5
47 offset: 1.5
48 projectRef:
49 # Replace "${PROJECT_ID?}" with your project ID
50 external: "projects/${PROJECT_ID?}"
View as plain text