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

feat(browser): Add graphqlClientIntegration #13783

Open
wants to merge 76 commits into
base: develop
Choose a base branch
from

Conversation

Zen-cronic
Copy link
Contributor

@Zen-cronic Zen-cronic commented Sep 25, 2024

Resolves #13399

Todo:

  • Support fetch spans and tests
  • Support graphql queries without a name
  • Enhance breadcrumb data

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

@Zen-cronic Zen-cronic requested a review from mydea September 26, 2024 15:05
@Zen-cronic
Copy link
Contributor Author

Zen-cronic commented Sep 26, 2024

  • Todo: fix failing fetch tests by removing body from non-graphql requests

@Zen-cronic Zen-cronic requested a review from mydea September 30, 2024 13:02
@Zen-cronic
Copy link
Contributor Author

Just wanted to inform about the failing tests:

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally found the time to review this in depth. Overall, I really like it, I left some comments with requests for changes. Mostly it is about moving stuff around, and avoiding any graphql-specific code in the "general" places. Also, please note that if you rebase this in develop, there are/will be a bunch of conflicts - this is mostly because the utils package is deprecated and all that code was moved to core.

@Zen-cronic
Copy link
Contributor Author

Zen-cronic commented Dec 20, 2024

noted, i'll implement the feedback. thanks for the comprehensive review!

  • update span hook
  • update breadcrumb hook
  • resolve rebase conflicts

will move on with the conflicts if the current implementation checks out

@Zen-cronic Zen-cronic requested a review from a team as a code owner January 7, 2025 15:53
@@ -0,0 +1,121 @@
import { SENTRY_XHR_DATA_KEY } from '@sentry-internal/browser-utils';
import { getBodyString } from '@sentry-internal/replay';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mydea should this util be in the replay package?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we use/need it here, I would move it to @sentry-internal/browser-utils, and use it from there both in replay and here!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise, this will lead to circular dependency issues :)

@Zen-cronic Zen-cronic requested a review from mydea January 7, 2025 18:58
packages/types/src/client.ts Outdated Show resolved Hide resolved
packages/types/src/client.ts Outdated Show resolved Hide resolved
…s other than string

- Moved internal `getFetchRequestArgBody` to `browser-utils`.
- Added unit tests.

Signed-off-by: Kaung Zin Hein <[email protected]>
@Zen-cronic
Copy link
Contributor Author

i'm not sure what's making the webkit tests flaky for the added integration tests; locally they all pass on consecutive runs via yarn test --project='webkit' graphQLClient

@mydea
Copy link
Member

mydea commented Feb 5, 2025

I can't push changes on your branch, so I opened a PR here: Zen-cronic#1 which should fix the remaining CI issues on your branch!

Lms24 and others added 7 commits February 5, 2025 09:33
…y#15265)

Due to a change in the lifecycle of Svelte
components in Svelte 5 (using Rune mode), our SDK can no longer leverage
the `(before|after)Update` hooks to track component update spans.
For v9, this patch therefore disables update tracking by default.
Removes a no longer necessary fallback check that we only needed in
SvelteKit 1.26.0 or older. For Kit 2.x, we can rely on the
`event.isSubRequest` flag to identify sub vs. actual requests in our
request handler.

fixes getsentry#15244
…try#15282)

- adds a toolbar for cropping and annotations
- changes from inline styles to multiple class names in BEM format

With annotation option:
![Screenshot 2025-02-03 at 3 51
04 PM](https://github.com/user-attachments/assets/97e4ac38-4926-49e5-a6f3-d474174e3c38)

Without annotation option (to confirm that it looks the same as before):
![Screenshot 2025-02-03 at 5 09
01 PM](https://github.com/user-attachments/assets/8b614c38-3c1b-4d7e-986e-ead86a3f4349)

Closes getsentry#15252
…etsentry#15288)

The debugging ability for Azure Functions when using Azure Static Web
Apps is very limited. But as I could see some Sentry-related logs I
**think** Sentry is generally initialized.

However, server-related logs don't show up in Sentry. This is
**probably** because the Azure Function finishes before the error can be
sent to Sentry.
By adding the Azure environment variable to check whether we should
flush with a timeout, this should possibly fix the issue.

Logs in Application Insights:

![image](https://github.com/user-attachments/assets/ed5ccd37-be87-4338-946b-94ec543e08c5)
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left two more comments, where we should use the passed in logger instance - other than, this this is ready to go 🚀 thanks for the work, this was a tricky one but it turned out pretty great! (also needs a rebase, there is one small conflict)

packages/browser-utils/src/networkUtils.ts Outdated Show resolved Hide resolved
packages/browser-utils/src/networkUtils.ts Outdated Show resolved Hide resolved
@Zen-cronic
Copy link
Contributor Author

all resolved now!

@lforst lforst self-assigned this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add optional graphqlClientIntegration to @sentry/browser
8 participants