Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Update sentry-javascript monorepo to v7.51.0 #10647

Merged
merged 1 commit into from
May 8, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 18, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@sentry/browser (source) 7.47.0 -> 7.51.0 age adoption passing confidence
@sentry/tracing (source) 7.47.0 -> 7.51.0 age adoption passing confidence

Release Notes

getsentry/sentry-javascript

v7.51.0

Compare Source

Important Changes
  • feat(sveltekit): Auto-wrap load functions with proxy module (#​7994)

@sentry/sveltekit now auto-wraps load functions in

  • +(page|layout).(ts|js) files (universal loads)
  • +(page|layout).server.(ts|js) files (server-only loads)

This means that you don't have to manually add the wrapLoadWithSentry and wrapServerLoadWithSentry functions around your load functions. The SDK will not interfere with already wrapped load functions.

For more details, take a look at the Readme

  • chore(angular): Upgrade peerDependencies to Angular 16 (#​8035)

We now officially support Angular 16 in @sentry/angular-ivy.
Note that @sentry/angular does not support Angular 16.

  • feat(node): Add ability to send cron monitor check ins (#​8039)

This release adds Sentry cron monitoring support to the Node SDK.

To monitor your cron jobs, send check-ins everytime you execute your cron jobs to Sentry. You can do this with the captureCheckIn method exported from the SDK. First you must send an in_progress, checkin, then you can send one with status ok or error based on what happened with your cron job.

const Sentry = require('@​sentry/node');

// ...

Sentry.captureCheckIn({
  // make sure this is the same slug as what you set up your
  // Sentry cron monitor with.
  monitorSlug: 'dailyEmail',
  status: 'in_progress',
});

const startTime = timeInSeconds();

runTask();

Sentry.captureCheckIn({
  monitorSlug: 'dailyEmail',
  status: 'ok',
  duration: timeInSeconds() - startTime,
});
Additional Features and Fixes
  • feat(browser): Export makeMultiplexedTransport from browser SDK (#​8012)
  • feat(node): Add http.method to node http spans (#​7991)
  • feat(tracing): add body size for fetch requests (#​7935)
  • feat(tracing): Use http.method for span data (#​7990)
  • fix(integrations): Handle windows paths with no prefix or backslash prefix in RewriteFrames (#​7995)
  • fix(node): Mark stack frames with url protocol as in-app frames (#​8008)
  • fix(remix): Export Integration type declaration as union type (#​8016)
  • fix(replay): Do not add replay_id to DSC while buffering (#​8020)
  • fix(tracing): Don't set method multiple times (#​8014)
  • fix(utils): Normalize undefined to undefined instead of "[undefined]" (#​8017)

Work in this release contributed by @​srubin and @​arjenbrandenburgh. Thank you for your contributions!

v7.50.0

Compare Source

Important Changes
  • doc(sveltekit): Promote the SDK to beta state (#​7976)
    • feat(sveltekit): Convert sentryHandle to a factory function (#​7975)

With this release, the Sveltekit SDK (@​sentry/sveltekit) is promoted to Beta.
This means that we do not expect any more breaking changes.

The final breaking change is that sentryHandle is now a function.
So in order to update to 7.50.0, you have to update your hooks.server.js file:

// hooks.server.js

// Old:
export const handle = sentryHandle;
// New:
export const handle = sentryHandle();
  • feat(replay): Allow to configure URLs to capture network bodies/headers (#​7953)

You can now capture request/response bodies & headers of network requests in Replay.
You have to define an allowlist of URLs you want to capture additional information for:

new Replay({
  networkDetailAllowUrls: ['https://sentry.io/api'],
});

By default, we will capture request/response bodies, as well as the request/response headers content-type, content-length and accept.
You can configure this with some additional configuration:

new Replay({
  networkDetailAllowUrls: ['https://sentry.io/api'],
  // opt-out of capturing bodies
  networkCaptureBodies: false,
  // These headers are captured _in addition to_ the default headers
  networkRequestHeaders: ['X-Custom-Header'],
  networkResponseHeaders: ['X-Custom-Header', 'X-Custom-Header-2']
});

Note that bodies will be truncated to a max length of ~150k characters.

- feat(replay): Changes of sampling behavior & public API

  • feat(replay): Change the behavior of error-based sampling (#​7768)
  • feat(replay): Change flush() API to record current event buffer (#​7743)
  • feat(replay): Change stop() to flush and remove current session (#​7741)

We have changed the behavior of error-based sampling, as well as adding & adjusting APIs a bit to be more aligned with expectations.
See Sampling for details.

We've also revamped some public APIs in order to be better aligned with expectations. See Stoping & Starting Replays manually for details.

  • feat(core): Add multiplexed transport (#​7926)

We added a new transport to support multiplexing.
With this, you can configure Sentry to send events to different DSNs, depending on a logic of your choosing:

import { makeMultiplexedTransport } from '@​sentry/core';
import { init, captureException, makeFetchTransport } from '@​sentry/browser';

function dsnFromFeature({ getEvent }) {
  const event = getEvent();
  switch(event?.tags?.feature) {
    case 'cart':
      return ['__CART_DSN__'];
    case 'gallery':
      return ['__GALLERY_DSN__'];
  }
  return []
}

init({
  dsn: '__FALLBACK_DSN__',
  transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature)
});
Additional Features and Fixes
  • feat(nextjs): Add disableLogger option that automatically tree shakes logger statements (#​7908)
  • feat(node): Make Undici a default integration. (#​7967)
  • feat(replay): Extend session idle time until expire to 15min (#​7955)
  • feat(tracing): Add db.system span data to DB spans (#​7952)
  • fix(core): Avoid crash when Function.prototype is frozen (#​7899)
  • fix(nextjs): Fix inject logic for Next.js 13.3.1 canary (#​7921)
  • fix(replay): Ensure console breadcrumb args are truncated (#​7917)
  • fix(replay): Ensure we do not set replayId on dsc if replay is disabled (#​7939)
  • fix(replay): Ensure we still truncate large bodies if they are failed JSON (#​7923)
  • fix(utils): default normalize() to a max. of 100 levels deep instead of Inifnity (#​7957)

Work in this release contributed by @​Jack-Works. Thank you for your contribution!

v7.49.0

Compare Source

Important Changes
  • feat(sveltekit): Read adapter output directory from svelte.config.js (#​7863)

Our source maps upload plugin is now able to read svelte.config.js. This is necessary to automatically find the output directory that users can specify when setting up the Node adapter.

  • fix(replay): Ensure we normalize scope breadcrumbs to max. depth to avoid circular ref (#​7915)

This release fixes a potential problem with how Replay captures console logs.
Any objects logged will now be cut off after a maximum depth of 10, as well as cutting off any properties after the 1000th.
This should ensure we do not accidentally capture massive console logs, where a stringified object could reach 100MB or more.

  • fix(utils): Normalize HTML elements as string (#​7916)

We used to normalize references to HTML elements as POJOs.
This is both not very easily understandable, as well as potentially large, as HTML elements may have properties attached to them.
With this change, we now normalize them to e.g. [HTMLElement: HTMLInputElement].

Additional Features and Fixes
  • feat(browser): Simplify stack parsers (#​7897)
  • feat(node): Add monitor upsert types (#​7914)
  • feat(replay): Truncate network bodies to max size (#​7875)
  • fix(gatsby): Don't crash build when auth token is missing (#​7858)
  • fix(gatsby): Use import for gatsby-browser.js instead of require (#​7889)
  • fix(nextjs): Handle braces in stack frame URLs (#​7900)
  • fix(nextjs): Mark value injection loader result as uncacheable (#​7870)
  • fix(node): Correct typo in trpc integration transaciton name (#​7871)
  • fix(node): reduce deepReadDirSync runtime complexity (#​7910)
  • fix(sveltekit): Avoid capturing "Not Found" errors in server handleError wrapper (#​7898)
  • fix(sveltekit): Detect sentry release before creating the Vite plugins (#​7902)
  • fix(sveltekit): Use sentry.properties file when uploading source maps (#​7890)
  • fix(tracing): Ensure we use s instead of ms for startTimestamp (#​7877)
  • ref(deprecate): Deprecate timestampWithMs (#​7878)
  • ref(nextjs): Don't use Sentry Webpack Plugin in dev mode (#​7901)

v7.48.0

Compare Source

Important Changes
  • feat(node): Add AsyncLocalStorage implementation of AsyncContextStrategy (#​7800)
    • feat(core): Extend AsyncContextStrategy to allow reuse of existing context (#​7778)
    • feat(core): Make runWithAsyncContext public API (#​7817)
    • feat(core): Add async context abstraction (#​7753)
    • feat(node): Adds domain implementation of AsyncContextStrategy (#​7767)
    • feat(node): Auto-select best AsyncContextStrategy for Node.js version (#​7804)
    • feat(node): Migrate to domains used through AsyncContextStrategy (#​7779)

This release switches the SDK to use AsyncLocalStorage as the async context isolation mechanism in the SDK for Node 14+. For Node 10 - 13, we continue to use the Node domain standard library, since AsyncLocalStorage is not supported there. Preliminary testing showed a 30% improvement in latency and rps when making the switch from domains to AsyncLocalStorage on Node 16.

If you want to manually add async context isolation to your application, you can use the new runWithAsyncContext API.

import * as Sentry from '@​sentry/node';

const requestHandler = (ctx, next) => {
  return new Promise((resolve, reject) => {
    Sentry.runWithAsyncContext(async () => {
      const hub = Sentry.getCurrentHub();

      hub.configureScope(scope =>
        scope.addEventProcessor(event =>
          Sentry.addRequestDataToEvent(event, ctx.request, {
            include: {
              user: false,
            },
          })
        )
      );

      try {
        await next();
      } catch (err) {
        reject(err);
      }
      resolve();
    });
  });
};

If you're manually using domains to isolate Sentry data, we strongly recommend switching to this API!

In addition to exporting runWithAsyncContext publicly, the SDK also uses it internally where we previously used domains.

  • feat(sveltekit): Remove withSentryViteConfig (#​7789)
    • feat(sveltekit): Remove SDK initialization via dedicated files (#​7791)

This release removes our withSentryViteConfig wrapper we previously instructed you to add to your vite.config.js file. It is replaced Vite plugins which you simply add to your Vite config, just like the sveltekit() Vite plugins. We believe this is a more transparent and Vite/SvelteKit-native way of applying build time modifications. Here's how to use the plugins:

// vite.config.js
import { sveltekit } from '@​sveltejs/kit/vite';
import { sentrySvelteKit } from '@​sentry/sveltekit';

export default {
  plugins: [sentrySvelteKit(), sveltekit()],
  // ... rest of your Vite config
};

Take a look at the README for updated instructions!

Furthermore, with this transition, we removed the possibility to intialize the SDK in dedicated sentry.(client|server).config.js files. Please use SvelteKit's hooks files to initialize the SDK.

Please note that these are breaking changes! We're sorry for the inconvenience but the SvelteKit SDK is still in alpha stage and we want to establish a clean and SvelteKit-friendly API before making the SDK stable. You have been warned ;)

  • feat(sveltekit): Add Sentry Vite Plugin to upload source maps (#​7811)

This release adds automatic upload of source maps to the SvelteKit SDK. No need to configure anything other than adding our Vite plugins to your SDK. The example above shows you how to do this.

Please make sure to follow the README to specify your Sentry auth token, as well as org and project slugs.

- feat(replay): Capture request & response headers (#​7816)

Replay now captures the content-length, content-type, and accept headers from requests and responses automatically.

Additional Features and Fixes
  • feat(browser): Export request instrumentation options (#​7818)
  • feat(core): Add async context abstraction (#​7753)
  • feat(core): Add DSC to all outgoing envelopes (#​7820)
  • feat(core): Cache processed stacks for debug IDs (#​7825)
  • feat(node): Add checkin envelope types (#​7777)
  • feat(replay): Add getReplayId() method (#​7822)
  • fix(browser): Adjust BrowserTransportOptions to support offline transport options (#​7775)
  • fix(browser): DOMException SecurityError stacktrace parsing bug (#​7821)
  • fix(core): Log warning when tracing extensions are missing (#​7601)
  • fix(core): Only call applyDebugMetadata for error events (#​7824)
  • fix(integrations): Ensure httpclient integration works with Request (#​7786)
  • fix(node): reuseExisting does not need to call bind on domain (#​7780)
  • fix(node): Fix domain scope inheritance (#​7799)
  • fix(node): Make trpcMiddleware factory synchronous (#​7802)
  • fix(serverless): Account when transaction undefined (#​7829)
  • fix(utils): Make xhr instrumentation independent of parallel running SDK versions (#​7836)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.


This change is marked as an internal change (Task), so will not be included in the changelog.

@renovate renovate bot requested a review from a team as a code owner April 18, 2023 11:43
@renovate renovate bot requested a review from justjanne April 18, 2023 11:43
@renovate renovate bot added Dependencies Pull requests that update a dependency file T-Task Refactoring, enabling or disabling functionality, other engineering tasks labels Apr 18, 2023
@renovate renovate bot enabled auto-merge April 18, 2023 11:43
@renovate renovate bot added this pull request to the merge queue Apr 18, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 18, 2023
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from 5832500 to fbff2e3 Compare April 18, 2023 13:43
@justjanne justjanne added this pull request to the merge queue Apr 18, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 18, 2023
github-merge-queue bot pushed a commit that referenced this pull request Apr 18, 2023
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from fbff2e3 to dbc7431 Compare April 18, 2023 15:06
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from dbc7431 to 17a60c3 Compare April 18, 2023 16:33
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from 17a60c3 to a6adbd7 Compare April 19, 2023 04:14
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from a6adbd7 to 192cbec Compare April 23, 2023 17:29
@renovate renovate bot changed the title Update sentry-javascript monorepo to v7.48.0 Update sentry-javascript monorepo to v7.49.0 Apr 23, 2023
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch 2 times, most recently from 3010a80 to 84f9fb4 Compare April 26, 2023 12:35
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from 84f9fb4 to cfe0c97 Compare April 30, 2023 08:13
@renovate renovate bot changed the title Update sentry-javascript monorepo to v7.49.0 Update sentry-javascript monorepo to v7.50.0 Apr 30, 2023
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from cfe0c97 to db87c60 Compare May 2, 2023 11:08
@renovate renovate bot force-pushed the renovate/sentry-javascript-monorepo branch from db87c60 to 5f24462 Compare May 7, 2023 15:49
@renovate renovate bot changed the title Update sentry-javascript monorepo to v7.50.0 Update sentry-javascript monorepo to v7.51.0 May 7, 2023
@justjanne justjanne added this pull request to the merge queue May 8, 2023
Merged via the queue into develop with commit 631ac74 May 8, 2023
@justjanne justjanne deleted the renovate/sentry-javascript-monorepo branch May 8, 2023 13:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Dependencies Pull requests that update a dependency file T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant