From 3d1295e4d588bd46115bf2d27199ec175c91e651 Mon Sep 17 00:00:00 2001 From: Linus Flood Date: Thu, 6 Feb 2025 13:40:12 +0000 Subject: [PATCH] Merged in fix/application-insights-sentry (pull request #1269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: application insights works again * fix: application insights works again Approved-by: Joakim Jäderberg --- instrumentation.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/instrumentation.ts b/instrumentation.ts index 13176a506..0268d8e78 100644 --- a/instrumentation.ts +++ b/instrumentation.ts @@ -3,8 +3,15 @@ import * as Sentry from "@sentry/nextjs" import { env } from "./env/server" export async function register() { - await configureSentry() + /* + Order matters! + + Sentry hooks into OpenTelemetry, modifying its behavior. + Application Insights relies on OpenTelemetry exporters, + and these may not work correctly if Sentry has already altered the instrumentation pipeline. + */ await configureApplicationInsights() + await configureSentry() } export const onRequestError = Sentry.captureRequestError