Skip to content

[BUG] OTel startActiveSpan swallows errors from promises #2749

Description

@up2066049

Description/Screenshot

const tracer = appInsights.trace.getTracer("tracer");
try {
    const result = await tracer.startActiveSpan("span", async () => {
        console.log("invoked");
        throw new Error("boom");
    });
    console.log("resolved", result);
} catch (e) {
    console.log("rejected", e);
}

Expected behavior

invoked
rejected Error: boom
    <anonymous>

Actual behavior

invoked
resolved undefined

Steps to Reproduce

  • OS/Browser: Firefox 152.0.6 / Any
  • SDK Version [e.g. 22]: @microsoft/applicationinsights-web v3.4.3
  • How you initialized the SDK: const appInsights = new ApplicationInsights({ config: {

Additional context
Pretty big blocker on usage of this API 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions