aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.41k stars 349 forks source link

telemetry: set requestId field on failure #5168

Closed justinmk3 closed 3 weeks ago

justinmk3 commented 3 weeks ago

Checking err instanceof ServiceException fails for SSOOIDCServiceException even though it subclasses @aws-sdk/smithy-client.ServiceException 😑

Example

2024-06-14 13:03:07.065 [debug] telemetry: aws_loginWithBrowser {
  Metadata: {
    id: 'codeWhispererConnectionExpired',
    source: 'vscodeComponent',
    action: 'connect',
    parentMetric: 'toolkit_invokeAction',
    isReAuth: 'true',
    credentialStartUrl: 'https://view.awsapps.com/start',
    duration: '25613',
    result: 'Failed',
    reason: 'InvalidRedirectUriException',
    reasonDesc: 'Requested client type must use loopback interface for redirect',
    requestId: '1aee48f3-1062-4efe-a761-b2079ae31ac9',
    awsAccount: 'not-set',
    awsRegion: 'us-east-1'
  },
  Value: 1,
  Unit: 'None'

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.