Skip to content

VCST-4717: Update App Insights module, use System.Diagnostics.Activity instead of App Insights directly#70

Open
ksavosteev wants to merge 5 commits into
devfrom
feat/VCST-4717
Open

VCST-4717: Update App Insights module, use System.Diagnostics.Activity instead of App Insights directly#70
ksavosteev wants to merge 5 commits into
devfrom
feat/VCST-4717

Conversation

@ksavosteev

@ksavosteev ksavosteev commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Description

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-4717

Artifact URL:

https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Xapi_3.1012.0-pr-70-c845.zip


Note

Medium Risk
Observability behavior and export paths change for all GraphQL traffic; mis-tagged activities could be dropped or under-reported in monitoring until validated in staging.

Overview
GraphQL request telemetry no longer uses TelemetryClient or custom RequestTelemetry operations. GraphQLHttpMiddlewareWithLogs enriches the ASP.NET Core Activity.Current with operation name, graphql.type, and error status/exceptions so any configured OpenTelemetry exporter (including Application Insights) receives the same signal indirectly.

The plain POST /graphql noise filter is reimplemented as an OpenTelemetry BaseProcessor<Activity> that clears Recorded on /graphql activities missing the graphql.type tag (i.e. not enriched by the middleware). Module startup registers it via AddOpenTelemetry().WithTracing(...) instead of AddApplicationInsightsTelemetryProcessor.

Package/manifest alignment: drops Microsoft.ApplicationInsights.AspNetCore from Xapi.Core, adds VirtoCommerce.ApplicationInsights.Core, and bumps platform/Application Insights module versions to the VCST-4717 alpha line.

Reviewed by Cursor Bugbot for commit c845be8. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e28b11e. Configure here.


using var operation = _telemetryClient.StartOperation(requestTelemetry);
activity.DisplayName = $"POST graphql/{request.OperationName}";
activity.SetTag("url.path", $"graphql/{request.OperationName}");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing leading slash in url.path tag value

Medium Severity

The url.path tag is set to graphql/{OperationName} without a leading /. The OpenTelemetry semantic convention defines url.path as the RFC 3986 URI path component, which for HTTP requests always starts with /. This non-standard value will appear incorrectly in Application Insights dashboards and may break alerts or queries that expect paths starting with /. The value likely needs to be $"/graphql/{request.OperationName}".

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e28b11e. Configure here.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant