Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a public API for sending exception telemetry (bypassing opt-in checks) and wires it through the telemetry sender/client abstraction so Application Insights can emit real ExceptionData when supported.
Changes:
- Extend the telemetry client abstraction with optional
logExceptionand use it fromBaseTelemetrySender.sendErrorDatawhen available. - Add
sendDangerousTelemetryException(...)to the reporter (and update public typings/docs). - Refactor App Insights event property preparation and bump package version to
1.5.0.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/common/baseTelemetrySender.ts | Adds logException support and changes error fallback payload shaping. |
| src/common/baseTelemetryReporter.ts | Adds sendDangerousTelemetryException(...) API and routes it through the sender. |
| src/common/appInsightsClientFactory.ts | Implements logException and refactors event data preparation/merging. |
| dist/telemetryReporter.d.ts | Exposes new API in public typings. |
| README.md | Documents new “Dangerous Methods” section and updates version gate. |
| package.json | Version bump to 1.5.0. |
| package-lock.json | Lockfile version bump alignment. |
Comments suppressed due to low confidence (1)
src/common/baseTelemetrySender.ts:88
sendErrorDatano longer preserves the documented/previous behavior wheredatacan be either aSenderDataobject or a plain properties bag. In the fallback branch you currently treatdataasSenderDataand only readsenderData.properties, so calls likesendErrorData(err, { prop1: 1 })will dropprop1entirely (and existing unit tests expect those keys to be included). Consider normalizingdatafirst: if it has apropertiesfield use that, otherwise treatdataitself as the properties object, then merge in the standard{ name, message, stack }fields.
// Fallback for clients without exception support (e.g., 1DS)
const errorData = { stack: exception.stack, message: exception.message, name: exception.name };
const senderData = data as SenderData | undefined;
const errorProperties = senderData?.properties ?? {};
const fallbackData: SenderData = {
properties: { ...errorProperties, ...errorData },
measurements: senderData?.measurements,
tagOverrides: senderData?.tagOverrides
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TylerLeonhardt
approved these changes
Feb 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add API for sending exception data