Skip to content

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

Merged
Nev (MSNev) merged 2 commits into
mainfrom
copilot/fix-requestdata-event-name
Apr 13, 2026
Merged

Nev (MSNev) merged 2 commits into
mainfrom
copilot/fix-requestdata-event-name

Conversation

Copilot AI commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

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 Nev (MSNev) April 13, 2026 18:44
@MSNev
Nev (MSNev) marked this pull request as ready for review April 13, 2026 18:52
@MSNev
Nev (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 Nev (MSNev) added this to the 3.4.2 milestone Apr 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
Nev (MSNev) merged commit 68ec510 into main Apr 13, 2026
13 checks passed
@MSNev
Nev (MSNev) deleted the copilot/fix-requestdata-event-name branch April 13, 2026 20:38
Hector Hernandez (hectorhdzg) added a commit that referenced this pull request Jun 18, 2026
* [Release] Increase version to 3.4.2

Maintenance release for the 3.4.x line:
- Prototype pollution hardening in extend()/objExtend() (#2735)
- OsPlugin emits correct CS 4.0 fields ext.os.name / ext.os.ver (#2732)
- RequestEnvelopeCreator uses correct request envelope name (#2724)
- Offline channel null-provider fix (#2734)
- Dependency vulnerability resolution and npm->pnpm migration (#2733)
- CI: drop Node 16, add Node 22 and 24 (#2731)

* Restore 3.0.4 row in AISKU CDN size table (PR review feedback)
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