{"name":"@sentry/tracing","version":"7.24.1","author":{"name":"Sentry"},"license":"MIT","_id":"@sentry/tracing@7.24.1","homepage":"https://github.com/getsentry/sentry-javascript/tree/master/packages/tracing","bugs":{"url":"https://github.com/getsentry/sentry-javascript/issues"},"dist":{"shasum":"8f947b01a6b836334f20fcb36441d69cede474c9","tarball":"http://registry-npm.ywwl.com/@sentry/tracing/download/@sentry/tracing-7.24.1.tgz","fileCount":231,"integrity":"sha512-Vp03aH7wMxLszFMZqVWPlDlqCP5mwAqqsh9nHWUJhyarGJjeacrMj+B+5qKKM4W/JNnbrHRTRLw2lL/szxj1KA==","signatures":[{"sig":"MEUCIFIkjwgRF6Hwxo25+UD/VJRSDdLLOB/qiETiVGE5IMcoAiEA3S9qkn7kB8sInYo9PNGozg3n+nH7PhwEfudywrI9ivo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1239407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkI4XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqrzg//Zd3kEhB7jUSPTYdsDdTJgwQ32XhPxqtWektq3KJNN3IXMNrz\r\npl2Z3+ju2yCFBGrDVaaTZerYt+nBgYvVPgM5kMd9pBgge5itBo2ciDq1+5tE\r\niUdcRZTq16RtDFxn9jYBRVQRY7n7UUjd4mBlj5zSFS8kN752aXsnOrGpEqyc\r\nlxveAcYAiIfCJBL1ScDGFFb/l5D5P/GQq0MjM/GUIiL8E+JIw03PwKgW/jWY\r\nEZWbvR7t/4RirsUoJHjm5ujOAgxm6AOTLnrvhsaj8ZO9QVcp+tRT+CHQLGVv\r\nK5UX7Ml5vsXDe1nn/5SJmPd5GS4AnulzfOubofYNg/hNfSDIw1EB+d12V0Ns\r\nHYzWJ+q2aR6xB/5unNmpjTj/6LaNE3NFGroQFxW/6Nymh66++cp2Zt7ZC6mz\r\nlvbS8La0V07YX4WaXvjrKFHAvNrXoNUB4SYfRI0irRVGD/m8qTQyLJ6qnRj3\r\njNeUWMN/zO3PmsEnMJdUNMORPBxqqVcNdWhL3+XWIBwIdmb4JUQ/Rmvit3kF\r\n3xJGpzVAEo2FnCo5K4Kln4I3EwakQ1FOaEd7RnVqRLieSA2YVuhGdOsR5DHm\r\n0m9efbvVlD+1pr1+yePSa9h8jqornvDNQrMu+YyzwFKR4axNvsgruRmDt4BD\r\nZi08zj/cyOI1yYtBibvAWHXxudoPflrv4Ms=\r\n=hZXi\r\n-----END PGP SIGNATURE-----\r\n","size":162067,"noattachment":false,"key":"/@sentry/tracing/-/@sentry/tracing-7.24.1.tgz"},"main":"cjs/index.js","_from":"file:/tmp/craft-23oFlh/sentry-tracing-7.24.1.tgz","types":"types/index.d.ts","module":"esm/index.js","engines":{"node":">=8"},"_npmUser":{"name":"sentry-bot","email":"accounts@sentry.io"},"_resolved":"","_integrity":"","repository":{"url":"git://github.com/getsentry/sentry-javascript.git","type":"git"},"_npmVersion":"6.14.17","description":"Extensions for Sentry AM","directories":{},"sideEffects":["./cjs/index.js","./esm/index.js","./build/npm/cjs/index.js","./build/npm/esm/index.js","./src/index.ts"],"_nodeVersion":"14.21.1","dependencies":{"tslib":"^1.9.3","@sentry/core":"7.24.1","@sentry/types":"7.24.1","@sentry/utils":"7.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/express":"^4.17.14","@sentry/browser":"7.24.1"},"_npmOperationalInternal":{"tmp":"tmp/tracing_7.24.1_1670417943061_0.3229750631516577","host":"s3://npm-registry-packages"},"readme":"<p align=\"center\">\n  <a href=\"https://sentry.io/?utm_source=github&utm_medium=logo\" target=\"_blank\">\n    <img src=\"https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png\" alt=\"Sentry\" width=\"280\" height=\"84\">\n  </a>\n</p>\n\n> ⚠️ **Deprecation Notice:** From SDK versions >= `7.47.0` onwards, the `@sentry/tracing` package is officially\n> deprecated. This package will be removed in a future major release. More details can be found in the\n> [migration docs](https://github.com/getsentry/sentry-javascript/blob/7.47.0/MIGRATION.md/#remove-requirement-for-sentrytracing-package-since-7460).\n\n# Sentry Tracing Extensions\n\n[![npm version](https://img.shields.io/npm/v/@sentry/tracing.svg)](https://www.npmjs.com/package/@sentry/tracing)\n[![npm dm](https://img.shields.io/npm/dm/@sentry/tracing.svg)](https://www.npmjs.com/package/@sentry/tracing)\n[![npm dt](https://img.shields.io/npm/dt/@sentry/tracing.svg)](https://www.npmjs.com/package/@sentry/tracing)\n\n## Package Discontinued\n\nThis package was discontinued with version 8.0.0 of the Sentry JavaScript SDKs. Instead, exports from this package are\nexported directly from the main SDK packages like `@sentry/react` or `@sentry/node`. For more information have a look at\nthe [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#sentrytracing).\n\n## Links\n\n- [Official SDK Docs](https://docs.sentry.io/quickstart/)\n- [TypeDoc](http://getsentry.github.io/sentry-javascript/)\n\n## General\n\nThis package contains extensions to the `@sentry/hub` to enable Sentry AM related functionality. It also provides\nintegrations for Browser and Node that provide a good experience out of the box.\n\n## Migrating from @sentry/apm to @sentry/tracing\n\nThe tracing integration for JavaScript SDKs has moved from [`@sentry/apm`](https://www.npmjs.com/package/@sentry/apm) to\n[`@sentry/tracing`](https://www.npmjs.com/package/@sentry/tracing). While the two packages are similar, some imports and\nAPIs have changed slightly.\n\nThe old package `@sentry/apm` is deprecated in favor of `@sentry/tracing`. Future support for `@sentry/apm` is limited\nto bug fixes only.\n\n## Migrating from @sentry/apm to @sentry/tracing\n\n### Browser (CDN bundle)\n\nIf you were using the Browser CDN bundle, switch from the old `bundle.apm.min.js` to the new tracing bundle:\n\n```html\n<script\n  src=\"https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js\"\n  integrity=\"sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}\"\n  crossorigin=\"anonymous\"\n></script>\n```\n\nAnd then update `Sentry.init`:\n\n```diff\n Sentry.init({\n-  integrations: [new Sentry.Integrations.Tracing()]\n+  integrations: [new Sentry.Integrations.BrowserTracing()]\n });\n```\n\n### Browser (npm package)\n\nIf you were using automatic instrumentation, update the import statement and update `Sentry.init` to use the new\n`BrowserTracing` integration:\n\n```diff\n import * as Sentry from \"@sentry/browser\";\n-import { Integrations } from \"@sentry/apm\";\n+import { Integrations } from \"@sentry/tracing\";\n\n Sentry.init({\n   integrations: [\n-    new Integrations.Tracing(),\n+    new Integrations.BrowserTracing(),\n   ]\n });\n```\n\nIf you were using the `beforeNavigate` option from the `Tracing` integration, the API in `BrowserTracing` has changed\nslightly. Instead of passing in a location and returning a string representing transaction name, `beforeNavigate` now\naccepts a transaction context and is expected to return a transaction context. You can now add extra tags or change the\n`op` based on different parameters. If you want to access the location like before, you can get it from\n`window.location`.\n\nFor example, if you had a function like so that computed a custom transaction name:\n\n```javascript\nimport * as Sentry from '@sentry/browser';\nimport { Integrations } from '@sentry/apm';\n\nSentry.init({\n  integrations: [\n    new Integrations.Tracing({\n      beforeNavigate: location => {\n        return getTransactionName(location);\n      },\n    }),\n  ],\n});\n```\n\nYou would now leverage the context to do the same thing:\n\n```javascript\nimport * as Sentry from '@sentry/browser';\nimport { Integrations } from '@sentry/tracing';\n\nSentry.init({\n  integrations: [\n    new Integrations.BrowserTracing({\n      beforeNavigate: context => {\n        return {\n          ...context,\n          // Can even look at context tags or other data to adjust\n          // transaction name\n          name: getTransactionName(window.location),\n        };\n      },\n    }),\n  ],\n});\n```\n\nFor the full diff:\n\n```diff\n import * as Sentry from \"@sentry/browser\";\n-import { Integrations } from \"@sentry/apm\";\n+import { Integrations } from \"@sentry/tracing\";\n\n Sentry.init({\n   integrations: [\n-    new Integrations.Tracing({\n-      beforeNavigate: (location) => {\n-        return getTransactionName(location)\n+    new Integrations.BrowserTracing({\n+      beforeNavigate: (ctx) => {\n+        return {\n+          ...ctx,\n+          name: getTransactionName(ctx.name, window.location)\n+        }\n       }\n     }),\n   ]\n });\n```\n\n### Node\n\nIf you were using the Express integration for automatic instrumentation, the only necessary change is to update the\nimport statement:\n\n```diff\n import * as Sentry from \"@sentry/node\";\n-import { Integrations } from \"@sentry/apm\";\n+import { Integrations } from \"@sentry/tracing\";\n\n Sentry.init({\n   integrations: [\n     new Integrations.Express(),\n   ]\n });\n```\n","publish_time":1670417943355,"maintainers":[{"name":"benvinegar","email":"ben@benv.ca"},{"name":"billyvg","email":"npm@mmo.me"},{"name":"mitsuhiko","email":"armin.ronacher@active-4.com"},{"name":"haza","email":"daniel.griesser.86@gmail.com"},{"name":"jauer","email":"account@jauer.org"},{"name":"sentry-bot","email":"accounts@sentry.io"},{"name":"evanpurkhiser","email":"evanpurkhiser@gmail.com"},{"name":"lynnagara","email":"lyn.nagara@gmail.com"},{"name":"leedongwei","email":"danny@dongwei.li"},{"name":"markstory","email":"mark@mark-story.com"},{"name":"zeeg","email":"dcramer@gmail.com"}],"_cnpm_publish_time":1670417943355,"dist-tags":{"latest":"7.120.4","next":"7.120.4-alpha.1","v7":"7.120.2"}}