From 37c6d14c50c92ae39ec3d077631dc57746b22e2a Mon Sep 17 00:00:00 2001 From: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:21:27 -0400 Subject: [PATCH] upcoming: [M3-8426] - Add Sentry Tag for Linode Create v2 (#10763) * add sentry tagging logic * Added changeset: Add Sentry Tag for Linode Create v2 --------- Co-authored-by: Banks Nussman --- .../pr-10763-upcoming-features-1723138942196.md | 5 +++++ .../src/features/Linodes/LinodeCreatev2/index.tsx | 14 ++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 packages/manager/.changeset/pr-10763-upcoming-features-1723138942196.md diff --git a/packages/manager/.changeset/pr-10763-upcoming-features-1723138942196.md b/packages/manager/.changeset/pr-10763-upcoming-features-1723138942196.md new file mode 100644 index 00000000000..cb9f61a0298 --- /dev/null +++ b/packages/manager/.changeset/pr-10763-upcoming-features-1723138942196.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Add Sentry Tag for Linode Create v2 ([#10763](https://github.com/linode/manager/pull/10763)) diff --git a/packages/manager/src/features/Linodes/LinodeCreatev2/index.tsx b/packages/manager/src/features/Linodes/LinodeCreatev2/index.tsx index db5792cf785..cfd83d1c7d5 100644 --- a/packages/manager/src/features/Linodes/LinodeCreatev2/index.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreatev2/index.tsx @@ -1,4 +1,5 @@ import { isEmpty } from '@linode/api-v4'; +import * as Sentry from '@sentry/react'; import { useQueryClient } from '@tanstack/react-query'; import { useSnackbar } from 'notistack'; import React, { useEffect, useRef } from 'react'; @@ -139,6 +140,19 @@ export const LinodeCreatev2 = () => { previousSubmitCount.current = form.formState.submitCount; }, [form.formState]); + /** + * Add a Sentry tag when Linode Create v2 is mounted + * so we differentiate errors. + * + * @todo remove once Linode Create v2 is live for all users + */ + useEffect(() => { + Sentry.setTag('Linode Create Version', 'v2'); + return () => { + Sentry.setTag('Linode Create Version', undefined); + }; + }, []); + return (