diff --git a/tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http00.log.real b/tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http00.log.real new file mode 100644 index 0000000000..be28dcc5ca --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http00.log.real @@ -0,0 +1,296 @@ +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, + "details": [ + { + "@type": "type.googleapis.com/google.rpc.DebugInfo", + "detail": "[ORIGINAL ERROR] generic::not_found: Metric logginglogmetric-${uniqueId} does not exist. [google.rpc.error_details_ext] { message: \"Metric logginglogmetric-${uniqueId} does not exist.\" }" + } + ], + "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}", + "resourceName": "projects/${projectId}/metrics/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}", + "resourceName": "projects/${projectId}/metrics/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}", + "resourceName": "projects/${projectId}/metrics/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}", + "resourceName": "projects/${projectId}/metrics/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}", + "resourceName": "projects/${projectId}/metrics/logginglogmetric-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "valueExtractor": "EXTRACT(jsonPayload.response)" +} \ No newline at end of file diff --git a/tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http01.log.real b/tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http01.log.real new file mode 100644 index 0000000000..429c8f43fc --- /dev/null +++ b/tests/e2e/testdata/scenarios/fields/management/logging/logmetric/set-zero/_http01.log.real @@ -0,0 +1,172 @@ +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}", + "resourceName": "projects/${projectId}/metrics/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": [ + 0, + 1 + ] + } + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "filter": "resource.type=gae_app AND severity\u003c=ERROR", + "labelExtractors": { + "testkey": "EXTRACT(jsonPayload.request)" + }, + "metricDescriptor": { + "labels": [ + { + "key": "testkey", + "valueType": "STRING" + } + ], + "metadata": {}, + "metricKind": "DELTA", + "valueType": "DISTRIBUTION" + }, + "name": "logginglogmetric-${uniqueId}", + "resourceName": "projects/${projectId}/metrics/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": [ + 0, + 1 + ] + } + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "filter": "resource.type=gae_app AND severity\u003c=ERROR", + "labelExtractors": { + "testkey": "EXTRACT(jsonPayload.request)" + }, + "metricDescriptor": { + "labels": [ + { + "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}", + "resourceName": "projects/${projectId}/metrics/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": [ + 0, + 1 + ] + } + }, + "createTime": "2024-04-01T12:34:56.123456Z", + "filter": "resource.type=gae_app AND severity\u003c=ERROR", + "labelExtractors": { + "testkey": "EXTRACT(jsonPayload.request)" + }, + "metricDescriptor": { + "labels": [ + { + "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}", + "resourceName": "projects/${projectId}/metrics/logginglogmetric-${uniqueId}", + "updateTime": "2024-04-01T12:34:56.123456Z", + "valueExtractor": "EXTRACT(jsonPayload.response)" +} \ No newline at end of file