forked from GoogleCloudPlatform/k8s-config-connector
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request GoogleCloudPlatform#3226 from GoogleCloudPlatform/…
…acpana/llm-0 tests: set 0 llm
- Loading branch information
Showing
9 changed files
with
1,154 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_export0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: logging.cnrm.cloud.google.com/v1beta1 | ||
kind: LoggingLogMetric | ||
metadata: | ||
name: logginglogmetric-${uniqueId} | ||
spec: | ||
bucketOptions: | ||
explicitBuckets: | ||
bounds: | ||
- 1.5 | ||
- 4.5 | ||
description: "" | ||
disabled: false | ||
filter: resource.type=gae_app AND severity<=ERROR | ||
labelExtractors: | ||
testkey: EXTRACT(jsonPayload.request) | ||
metricDescriptor: | ||
displayName: a concise name | ||
labels: | ||
- description: a label description | ||
key: testkey | ||
valueType: STRING | ||
launchStage: "" | ||
metricKind: DELTA | ||
unit: "" | ||
valueType: DISTRIBUTION | ||
projectRef: | ||
external: ${projectId} | ||
valueExtractor: EXTRACT(jsonPayload.response) |
28 changes: 28 additions & 0 deletions
28
tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_export1.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: logging.cnrm.cloud.google.com/v1beta1 | ||
kind: LoggingLogMetric | ||
metadata: | ||
name: logginglogmetric-${uniqueId} | ||
spec: | ||
bucketOptions: | ||
explicitBuckets: | ||
bounds: | ||
- 0 | ||
- 1 | ||
description: "" | ||
disabled: false | ||
filter: resource.type=gae_app AND severity<=ERROR | ||
labelExtractors: | ||
testkey: EXTRACT(jsonPayload.request) | ||
metricDescriptor: | ||
displayName: "" | ||
labels: | ||
- description: "" | ||
key: testkey | ||
valueType: STRING | ||
launchStage: "" | ||
metricKind: DELTA | ||
unit: "" | ||
valueType: DISTRIBUTION | ||
projectRef: | ||
external: ${projectId} | ||
valueExtractor: EXTRACT(jsonPayload.response) |
285 changes: 285 additions & 0 deletions
285
tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http00.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,285 @@ | ||
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false | ||
User-Agent: kcc/controller-manager | ||
|
||
404 Not Found | ||
Cache-Control: private | ||
Content-Type: application/json; charset=UTF-8 | ||
Server: ESF | ||
Vary: Origin | ||
Vary: X-Origin | ||
Vary: Referer | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Xss-Protection: 0 | ||
|
||
{ | ||
"error": { | ||
"code": 404, | ||
"message": "Metric logginglogmetric-${uniqueId} does not exist.", | ||
"status": "NOT_FOUND" | ||
} | ||
} | ||
|
||
--- | ||
|
||
POST https://logging.googleapis.com/v2/projects/${projectId}/metrics?alt=json&prettyPrint=false | ||
Content-Type: application/json | ||
User-Agent: kcc/controller-manager | ||
|
||
{ | ||
"bucketOptions": { | ||
"explicitBuckets": { | ||
"bounds": [ | ||
1.5, | ||
4.5 | ||
] | ||
} | ||
}, | ||
"filter": "resource.type=gae_app AND severity\u003c=ERROR", | ||
"labelExtractors": { | ||
"testkey": "EXTRACT(jsonPayload.request)" | ||
}, | ||
"metricDescriptor": { | ||
"displayName": "a concise name", | ||
"labels": [ | ||
{ | ||
"description": "a label description", | ||
"key": "testkey", | ||
"valueType": "STRING" | ||
} | ||
], | ||
"launchStage": "EARLY_ACCESS", | ||
"metadata": { | ||
"ingestDelay": "1s", | ||
"samplePeriod": "1s" | ||
}, | ||
"metricKind": "DELTA", | ||
"valueType": "DISTRIBUTION" | ||
}, | ||
"name": "logginglogmetric-${uniqueId}", | ||
"valueExtractor": "EXTRACT(jsonPayload.response)" | ||
} | ||
|
||
200 OK | ||
Cache-Control: private | ||
Content-Type: application/json; charset=UTF-8 | ||
Server: ESF | ||
Vary: Origin | ||
Vary: X-Origin | ||
Vary: Referer | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Xss-Protection: 0 | ||
|
||
{ | ||
"bucketOptions": { | ||
"explicitBuckets": { | ||
"bounds": [ | ||
1.5, | ||
4.5 | ||
] | ||
} | ||
}, | ||
"createTime": "2024-04-01T12:34:56.123456Z", | ||
"filter": "resource.type=gae_app AND severity\u003c=ERROR", | ||
"labelExtractors": { | ||
"testkey": "EXTRACT(jsonPayload.request)" | ||
}, | ||
"metricDescriptor": { | ||
"displayName": "a concise name", | ||
"labels": [ | ||
{ | ||
"description": "a label description", | ||
"key": "testkey" | ||
} | ||
], | ||
"metricKind": "DELTA", | ||
"name": "projects/${projectId}/metricDescriptors/logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"type": "logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"valueType": "DISTRIBUTION" | ||
}, | ||
"name": "logginglogmetric-${uniqueId}", | ||
"updateTime": "2024-04-01T12:34:56.123456Z", | ||
"valueExtractor": "EXTRACT(jsonPayload.response)" | ||
} | ||
|
||
--- | ||
|
||
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false | ||
User-Agent: kcc/controller-manager | ||
|
||
200 OK | ||
Cache-Control: private | ||
Content-Type: application/json; charset=UTF-8 | ||
Server: ESF | ||
Vary: Origin | ||
Vary: X-Origin | ||
Vary: Referer | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Xss-Protection: 0 | ||
|
||
{ | ||
"bucketOptions": { | ||
"explicitBuckets": { | ||
"bounds": [ | ||
1.5, | ||
4.5 | ||
] | ||
} | ||
}, | ||
"createTime": "2024-04-01T12:34:56.123456Z", | ||
"filter": "resource.type=gae_app AND severity\u003c=ERROR", | ||
"labelExtractors": { | ||
"testkey": "EXTRACT(jsonPayload.request)" | ||
}, | ||
"metricDescriptor": { | ||
"displayName": "a concise name", | ||
"labels": [ | ||
{ | ||
"description": "a label description", | ||
"key": "testkey" | ||
} | ||
], | ||
"metricKind": "DELTA", | ||
"name": "projects/${projectId}/metricDescriptors/logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"type": "logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"valueType": "DISTRIBUTION" | ||
}, | ||
"name": "logginglogmetric-${uniqueId}", | ||
"updateTime": "2024-04-01T12:34:56.123456Z", | ||
"valueExtractor": "EXTRACT(jsonPayload.response)" | ||
} | ||
|
||
--- | ||
|
||
PUT https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false | ||
Content-Type: application/json | ||
User-Agent: kcc/controller-manager | ||
|
||
{ | ||
"bucketOptions": { | ||
"explicitBuckets": { | ||
"bounds": [ | ||
1.5, | ||
4.5 | ||
] | ||
} | ||
}, | ||
"createTime": "2024-04-01T12:34:56.123456Z", | ||
"filter": "resource.type=gae_app AND severity\u003c=ERROR", | ||
"labelExtractors": { | ||
"testkey": "EXTRACT(jsonPayload.request)" | ||
}, | ||
"metricDescriptor": { | ||
"displayName": "a concise name", | ||
"labels": [ | ||
{ | ||
"description": "a label description", | ||
"key": "testkey", | ||
"valueType": "STRING" | ||
} | ||
], | ||
"launchStage": "EARLY_ACCESS", | ||
"metadata": { | ||
"ingestDelay": "1s", | ||
"samplePeriod": "1s" | ||
}, | ||
"metricKind": "DELTA", | ||
"valueType": "DISTRIBUTION" | ||
}, | ||
"name": "logginglogmetric-${uniqueId}", | ||
"updateTime": "2024-04-01T12:34:56.123456Z", | ||
"valueExtractor": "EXTRACT(jsonPayload.response)" | ||
} | ||
|
||
200 OK | ||
Cache-Control: private | ||
Content-Type: application/json; charset=UTF-8 | ||
Server: ESF | ||
Vary: Origin | ||
Vary: X-Origin | ||
Vary: Referer | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Xss-Protection: 0 | ||
|
||
{ | ||
"bucketOptions": { | ||
"explicitBuckets": { | ||
"bounds": [ | ||
1.5, | ||
4.5 | ||
] | ||
} | ||
}, | ||
"createTime": "2024-04-01T12:34:56.123456Z", | ||
"filter": "resource.type=gae_app AND severity\u003c=ERROR", | ||
"labelExtractors": { | ||
"testkey": "EXTRACT(jsonPayload.request)" | ||
}, | ||
"metricDescriptor": { | ||
"displayName": "a concise name", | ||
"labels": [ | ||
{ | ||
"description": "a label description", | ||
"key": "testkey" | ||
} | ||
], | ||
"metricKind": "DELTA", | ||
"name": "projects/${projectId}/metricDescriptors/logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"type": "logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"valueType": "DISTRIBUTION" | ||
}, | ||
"name": "logginglogmetric-${uniqueId}", | ||
"updateTime": "2024-04-01T12:34:56.123456Z", | ||
"valueExtractor": "EXTRACT(jsonPayload.response)" | ||
} | ||
|
||
--- | ||
|
||
GET https://logging.googleapis.com/v2/projects/${projectId}/metrics/logginglogmetric-${uniqueId}?alt=json&prettyPrint=false | ||
User-Agent: kcc/controller-manager | ||
|
||
200 OK | ||
Cache-Control: private | ||
Content-Type: application/json; charset=UTF-8 | ||
Server: ESF | ||
Vary: Origin | ||
Vary: X-Origin | ||
Vary: Referer | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Xss-Protection: 0 | ||
|
||
{ | ||
"bucketOptions": { | ||
"explicitBuckets": { | ||
"bounds": [ | ||
1.5, | ||
4.5 | ||
] | ||
} | ||
}, | ||
"createTime": "2024-04-01T12:34:56.123456Z", | ||
"filter": "resource.type=gae_app AND severity\u003c=ERROR", | ||
"labelExtractors": { | ||
"testkey": "EXTRACT(jsonPayload.request)" | ||
}, | ||
"metricDescriptor": { | ||
"displayName": "a concise name", | ||
"labels": [ | ||
{ | ||
"description": "a label description", | ||
"key": "testkey" | ||
} | ||
], | ||
"metricKind": "DELTA", | ||
"name": "projects/${projectId}/metricDescriptors/logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"type": "logging.googleapis.com/user/logginglogmetric-${uniqueId}", | ||
"valueType": "DISTRIBUTION" | ||
}, | ||
"name": "logginglogmetric-${uniqueId}", | ||
"updateTime": "2024-04-01T12:34:56.123456Z", | ||
"valueExtractor": "EXTRACT(jsonPayload.response)" | ||
} |
Oops, something went wrong.