Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils & azure: Add new error telemetry properties #1776

Merged
merged 19 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
813f1e8
Revert "Add showWorkspaceFolderPick to AzExtUserInput"
MicroFish91 May 29, 2024
033006b
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 May 29, 2024
497b33d
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 May 31, 2024
6d410f5
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jun 3, 2024
76d1342
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jun 5, 2024
3a98aad
tMerge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jun 6, 2024
b4baf0f
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jul 5, 2024
5f9491f
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jul 8, 2024
992c318
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jul 9, 2024
81cc3b0
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Jul 25, 2024
a76bb12
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Aug 2, 2024
4cba67b
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Aug 5, 2024
5cc6088
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Aug 6, 2024
6d05c54
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Aug 13, 2024
a3d7167
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Aug 20, 2024
b9da230
Merge branch 'main' of https://github.com/microsoft/vscode-azuretools
MicroFish91 Aug 26, 2024
c50405b
Add duplicate properties error properties and deprecated old ones
MicroFish91 Aug 26, 2024
f14656b
Update comments
MicroFish91 Aug 26, 2024
1c41dde
Feedback change to v2
MicroFish91 Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions azure/src/wizard/VerifyProvidersStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import type { Provider, ResourceManagementClient } from '@azure/arm-resources';
import { AzureWizardExecuteStep, ISubscriptionActionContext, parseError } from '@microsoft/vscode-azext-utils';
import { AzureWizardExecuteStep, IParsedError, ISubscriptionActionContext, parseError } from '@microsoft/vscode-azext-utils';
import { l10n, Progress } from 'vscode';
import * as types from '../../index';
import { createResourcesClient } from '../clients';
Expand Down Expand Up @@ -39,7 +39,18 @@ export class VerifyProvidersStep<T extends ISubscriptionActionContext> extends A
}
} catch (error) {
// ignore and continue with wizard. An error here would likely be confusing and un-actionable
context.telemetry.properties.providerError = parseError(error).message;
const perror: IParsedError = parseError(error);

/**
* @param providerError
* @deprecated
* Continue to emit telemetry for clients who are still using this property. You should suppress this property if you need to migrate to the new replacement.
*
* @param providerError2
* A duplicate replacement of the `providerError` telemetry property.
*/
context.telemetry.properties.providerError = perror.message;
context.telemetry.properties.providerError2 = perror.message;
MicroFish91 marked this conversation as resolved.
Show resolved Hide resolved
}
}));
}
Expand Down
11 changes: 11 additions & 0 deletions utils/src/callWithTelemetryAndErrorHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,18 @@ function handleError(context: types.IActionContext, callbackId: string, error: u
} else {
context.telemetry.properties.result = 'Failed';
context.telemetry.properties.error = errorData.errorType;

/**
* @param errorMessage
* @deprecated
* Continue to emit telemetry for clients who are still using this property. You should suppress this property if you need to migrate to the new replacement.
*
* @param errorMessage2
* A duplicate replacement of the `errorMessage` telemetry property which should be used instead.
*/
context.telemetry.properties.errorMessage = errorData.message;
context.telemetry.properties.errorMessage2 = errorData.message;
bwateratmsft marked this conversation as resolved.
Show resolved Hide resolved

context.telemetry.properties.stack = errorData.stack ? limitLines(errorData.stack, maxStackLines) : undefined;
if (context.telemetry.suppressIfSuccessful || context.telemetry.suppressAll) {
context.telemetry.properties.suppressTelemetry = 'true';
Expand Down
Loading