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

Clarify When Span-based Exception Events are Exported to App Insights #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion articles/azure-monitor/app/opentelemetry-add-modify.md
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,9 @@ span.recordException(e);

#### [Node.js](#tab/nodejs)

The Node.js SDK will only export these manually recorded span-based exceptions to Application Insights as exceptions if they are recorded on the children of
remote, internal spans, or if the exception is recorded on a top level span.

```javascript
// Import the Azure Monitor OpenTelemetry plugin and OpenTelemetry API
const { useAzureMonitor } = require("@azure/monitor-opentelemetry");
Expand All @@ -1287,7 +1290,7 @@ const tracer = trace.getTracer("testTracer");
let span = tracer.startSpan("hello");

// Try to throw an error
try{
try {
throw new Error("Test Error");
}

Expand Down