Skip to content

fix: RequestEnvelopeCreator sends "RequestData" as envelope name instead of "Microsoft.ApplicationInsights.{ikey}.Request"#2724

Merged
MSNev merged 2 commits intomainfrom
copilot/fix-requestdata-event-name
Apr 13, 2026
Merged

fix: RequestEnvelopeCreator sends "RequestData" as envelope name instead of "Microsoft.ApplicationInsights.{ikey}.Request"#2724
MSNev merged 2 commits intomainfrom
copilot/fix-requestdata-event-name

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

RequestEnvelopeCreator was passing RequestDataType ("RequestData") as the envelopeType to _createEnvelope instead of RequestEnvelopeType ("Microsoft.ApplicationInsights.{0}.Request"). This caused the IEnvelope name field — the event name sent to the Breeze endpoint — to be "RequestData" rather than the expected "Microsoft.ApplicationInsights.<ikey>.Request".

Change

  • EnvelopeCreator.ts: Import RequestEnvelopeType from ./Telemetry/RequestData and pass it to _createEnvelope in RequestEnvelopeCreator, consistent with how DependencyEnvelopeCreator uses RemoteDependencyEnvelopeType.
// Before (incorrect)
return _createEnvelope<IRequestData & ISerializable>(logger, RequestDataType, telemetryItem, data);

// After (correct)
return _createEnvelope<IRequestData & ISerializable>(logger, RequestEnvelopeType, telemetryItem, data);

RequestDataType is still correctly used for the inner _createData call (the baseType field of the data wrapper); only the outer envelope name is affected by this fix.

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

…elopeCreator

The RequestEnvelopeCreator function was incorrectly passing RequestDataType
(="RequestData") as the envelope type to _createEnvelope. This caused the
envelope name to be set to "RequestData" instead of the correct value
"Microsoft.ApplicationInsights.{0}.Request" which gets resolved to
"Microsoft.ApplicationInsights.[ikey].Request" when processed.

This bug matches the same pattern as DependencyEnvelopeCreator, which
correctly uses RemoteDependencyEnvelopeType.

Agent-Logs-Url: https://github.com/microsoft/ApplicationInsights-JS/sessions/b0c7586e-a66a-48c6-8fc1-59421404eba6

Co-authored-by: MSNev <54870357+MSNev@users.noreply.github.com>
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI changed the title [WIP] Fix event name for RequestData spans fix: RequestEnvelopeCreator sends "RequestData" as envelope name instead of "Microsoft.ApplicationInsights.{ikey}.Request" Apr 13, 2026
Copilot AI requested a review from MSNev April 13, 2026 18:44
@MSNev MSNev marked this pull request as ready for review April 13, 2026 18:52
@MSNev MSNev requested a review from a team as a code owner April 13, 2026 18:52
Copilot AI review requested due to automatic review settings April 13, 2026 18:52
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines:
Successfully started running 1 pipeline(s).

@MSNev MSNev added this to the 3.4.2 milestone Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes outgoing Request telemetry envelopes so the Breeze event name (IEnvelope.name) uses the correct Request envelope type (Microsoft.ApplicationInsights.{ikey}.Request) instead of incorrectly using the inner data type (RequestData).

Changes:

  • Import RequestEnvelopeType from ./Telemetry/RequestData.
  • Update RequestEnvelopeCreator to pass RequestEnvelopeType into _createEnvelope while still using RequestDataType for _createData.

@MSNev MSNev merged commit 68ec510 into main Apr 13, 2026
13 checks passed
@MSNev MSNev deleted the copilot/fix-requestdata-event-name branch April 13, 2026 20:38
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.

[BUG] There are some Span combinations which result in an Event Name of "RequestData" it should be a proper name

4 participants