|
| 1 | +/*! |
| 2 | + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + */ |
| 5 | + |
| 6 | +/** |
| 7 | + * TODO: Fix calls to these metrics and remove this file. |
| 8 | + * NOTE: Do NOT add additional metrics here, your PR will be rejected. All new metrics should pass validation. |
| 9 | + * |
| 10 | + * Checks were added to all emitted telemetry metrics to ensure they contain the correct properties. |
| 11 | + * This check does not exist outside test/automated runtimes because the error is not useful |
| 12 | + * for the user and doesn't break telemetry. |
| 13 | + * |
| 14 | + * These are metrics that fail validation and are emitted by code that is covered in test cases. |
| 15 | + * This allowlist exists to fix these incrementally and not have CI fail in the meantime. |
| 16 | + */ |
| 17 | +const validationExemptMetrics: Set<string> = new Set([ |
| 18 | + 'amazonq_runCommand', |
| 19 | + 'amazonq_isReviewedChanges', |
| 20 | + 'apigateway_copyUrl', |
| 21 | + 'aws_loadCredentials', |
| 22 | + 'aws_validateCredentials', |
| 23 | + 'cloudwatchlogs_download', |
| 24 | + 'codeTransform_isDoubleClickedToTriggerInvalidProject', |
| 25 | + 'codeTransform_jobIsCancelledByUser', |
| 26 | + 'codeTransform_jobStatusChanged', |
| 27 | + 'codeTransform_logApiError', |
| 28 | + 'codeTransform_logApiLatency', |
| 29 | + 'codewhisperer_userDecision', |
| 30 | + 'codewhisperer_codeScanIssueHover', |
| 31 | + 'codewhisperer_codePercentage', |
| 32 | + 'codewhisperer_userModification', |
| 33 | + 'codewhisperer_userTriggerDecision', |
| 34 | + 'dynamicresource_selectResources', |
| 35 | + 'dynamicresource_copyIdentifier', |
| 36 | + 'dynamicresource_mutateResource', |
| 37 | + 'dynamicresource_getResource', |
| 38 | + 'dynamicresource_listResource', |
| 39 | + 'ecr_copyRepositoryUri', |
| 40 | + 'ecr_copyTagUri', |
| 41 | + 'ecr_createRepository', |
| 42 | + 'ecr_deleteRepository', |
| 43 | + 'ecr_deleteTags', |
| 44 | + 'feedback_result', |
| 45 | + 'lambda_delete', |
| 46 | + 's3_uploadObject', |
| 47 | + 'sam_deploy', |
| 48 | + 'session_start', |
| 49 | + 'ssm_deleteDocument', |
| 50 | + 'ssm_openDocument', |
| 51 | + 'ssm_publishDocument', |
| 52 | + 'ssm_updateDocumentVersion', |
| 53 | + 'stepfunctions_previewstatemachine', |
| 54 | + 'ui_click', |
| 55 | + 'vscode_activeRegions', |
| 56 | + 'vscode_executeCommand', |
| 57 | +]) |
| 58 | + |
| 59 | +export function isValidationExemptMetric(metricName: string) { |
| 60 | + return validationExemptMetrics.has(metricName) |
| 61 | +} |
0 commit comments