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

perf: add spec-not-valid-details in validate-api-spec telemetry #11974

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions packages/fx-core/src/component/generator/apiSpec/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { pluginManifestUtils } from "../../driver/teamsApp/utils/PluginManifestU
const enum telemetryProperties {
validationStatus = "validation-status",
validationErrors = "validation-errors",
specNotValidDetails = "spec-not-valid-details",
validationWarnings = "validation-warnings",
validApisCount = "valid-apis-count",
allApisCount = "all-apis-count",
Expand Down Expand Up @@ -361,6 +362,12 @@ export function logValidationResults(
.map((warn: WarningResult) => formatTelemetryValidationProperty(warn))
.join(";"),
};

const specNotValidError = errors.find((error) => error.type === ErrorType.SpecNotValid);
if (specNotValidError) {
properties[telemetryProperties.specNotValidDetails] = specNotValidError.content;
}

if (existingCorrelationId) {
properties["correlation-id"] = existingCorrelationId;
}
Expand Down
Loading